[PC-BSD Commits] r21654 - in pcbsd-projects/PCDM: . rc.d

svn at pcbsd.org svn at pcbsd.org
Tue Feb 26 11:49:48 PST 2013


Author: kenmoore
Date: 2013-02-26 19:49:47 +0000 (Tue, 26 Feb 2013)
New Revision: 21654

Added:
   pcbsd-projects/PCDM/PCDMd
Removed:
   pcbsd-projects/PCDM/startPCDM
Modified:
   pcbsd-projects/PCDM/PCDM.pro
   pcbsd-projects/PCDM/main.cpp
   pcbsd-projects/PCDM/pcdm-gui.cpp
   pcbsd-projects/PCDM/rc.d/pcdm
Log:
Setup the return codes format so the PCDM daemon can tell whether to restart the login UI or not.



Modified: pcbsd-projects/PCDM/PCDM.pro
===================================================================
--- pcbsd-projects/PCDM/PCDM.pro	2013-02-26 19:31:34 UTC (rev 21653)
+++ pcbsd-projects/PCDM/PCDM.pro	2013-02-26 19:49:47 UTC (rev 21654)
@@ -97,10 +97,14 @@
 dotrans.path=/usr/local/share/PCDM/i18n/
 dotrans.extra=cd i18n && lrelease-qt4 -nounfinished *.ts && cp *.qm /usr/local/share/PCDM/i18n/
 
-scripts=startPCDM
-scripts.path=/usr/local/bin
-scripts.extra=cp startPCDM /usr/local/bin/startPCDM
+scripts=PCDMd
+scripts.path=/usr/local/sbin
+scripts.extra=cp PCDMd /usr/local/sbin/PCDMd
 
-INSTALLS += scripts dotrans target
+rcd=rc.d/pcdm
+rcd.path=/usr/local/etc/rc.d
+rcd.extra=cp rc.d/pcdm /usr/local/etc/rc.d/pcdm
 
+INSTALLS += dotrans scripts rcd target
+
 RESOURCES += PCDM.qrc

Modified: pcbsd-projects/PCDM/main.cpp
===================================================================
--- pcbsd-projects/PCDM/main.cpp	2013-02-26 19:31:34 UTC (rev 21653)
+++ pcbsd-projects/PCDM/main.cpp	2013-02-26 19:49:47 UTC (rev 21654)
@@ -124,11 +124,14 @@
     //qDebug() << "Showing GUI:" << QString::number(clock.elapsed())+" ms";
     w.show();
     returnCode = a.exec();
-    Backend::startXSession();
+    //Return Codes: 0=normal, 1=restart computer, 2=shutdown computer
+    if(returnCode==0){ Backend::startXSession(); }
   }  // end of PCDM GUI running
   
   //Wait for the desktop session to finish before exiting
-  desktop.waitForFinished();
+  if(returnCode == 0){
+    desktop.waitForFinished();
+  }
   
   return returnCode;
 }

Modified: pcbsd-projects/PCDM/pcdm-gui.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.cpp	2013-02-26 19:31:34 UTC (rev 21653)
+++ pcbsd-projects/PCDM/pcdm-gui.cpp	2013-02-26 19:49:47 UTC (rev 21654)
@@ -262,6 +262,7 @@
   if(ret == QMessageBox::Yes){
     Backend::log("PCDM: Shutting down computer");
     system("shutdown -p now");
+    QCoreApplication::exit(2);
     close();
   }
 }
@@ -278,12 +279,14 @@
   if(ret == QMessageBox::Yes){
     Backend::log("PCDM: Restarting computer");
     system("shutdown -r now");
+    QCoreApplication::exit(1);
     close();
   }
 }
 
 void PCDMgui::slotClosePCDM(){
   system("killall -9 xvkbd"); //be sure to close the virtual keyboard
+  QCoreApplication::exit(0);
   close();
 }
 

Modified: pcbsd-projects/PCDM/rc.d/pcdm
===================================================================
--- pcbsd-projects/PCDM/rc.d/pcdm	2013-02-26 19:31:34 UTC (rev 21653)
+++ pcbsd-projects/PCDM/rc.d/pcdm	2013-02-26 19:49:47 UTC (rev 21654)
@@ -9,12 +9,7 @@
 #
 
 . /etc/rc.subr
-#. /usr/local/etc/gnome.subr
 
-#pcdm_enable=${pcdm_enable-"NO"}
-#pcdm_preserve_base_pam_conf=${pcdm_preserve_base_pam_conf-NO}
-#pcdm_lang=${pcdm_lang-${LANG}}
-
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
 
 setup_xorg() {
@@ -50,9 +45,8 @@
 
 name="pcdm"
 rcvar=pcdm_enable
-command="/usr/local/bin/startPCDM"
-pidfile="/var/run/${name}.pid"
-procname="/usr/local/bin/PCDM-session"
+command="/usr/local/sbin/PCDMd"
+pidfile="/var/run/PCDMd.pid"
 start_cmd="${name}_start"
 
 load_rc_config ${name}
@@ -63,36 +57,8 @@
     if ! checkyesno pcdm_enable ; then
 	return 0
     fi
-    echo "Starting ${name}."
-   
-    # Update the pixbuf cache, otherwise weirdness insues
-    #gdk-pixbuf-query-loaders --update-cache
+    echo "Starting PCDM login daemon."
 
-    # make sure there is no pam configuration for gdm service in base system
-    #if ! checkyesno gdm_preserve_base_pam_conf && [ -f /etc/pam.d/gdm ]; then
-	#cp -p /etc/pam.d/gdm /etc/pam.d/gdm_disabled
-    	#rm -f /etc/pam.d/gdm
-    #fi
-
-    #( iter=0
-    #while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
-    	#This looks at all the tty terminals available
-	#if [ ${iter} -eq 60 ]; then
-	    #break
-	#fi
-	#sleep 1
-	#iter=$(expr ${iter} + 1)
-    #done
-    #iter=0
-    #while ! /usr/local/bin/lshal >/dev/null 2>&1 ; do
-    	#This looks at the HAL device info for the computer
-	#if [ ${iter} -eq 60 ]; then
-	    #break
-	#fi
-	#sleep 1
-	#iter=$(expr ${iter} + 1)
-    #done
-
     # If the user wants to switch to failsafe X
     if [ ${xvesa} = "YES" ]; then
 	setup_xvesa
@@ -111,7 +77,6 @@
     #Start the PCDM login daemon
     ${command} ${pcdm_flags} 
     #) &
-
 }
 
 run_rc_command "$1"



More information about the Commits mailing list