Author: dnicholson
Date: 2007-10-21 10:33:30 -0600 (Sun, 21 Oct 2007)
New Revision: 7121

Modified:
   trunk/bootscripts/ChangeLog
   trunk/bootscripts/blfs/init.d/dbus
   trunk/bootscripts/blfs/init.d/samba
   trunk/bootscripts/blfs/init.d/sshd
Log:
Use pid files in samba and sshd, add missing $pidfile spot in dbus


Modified: trunk/bootscripts/ChangeLog
===================================================================
--- trunk/bootscripts/ChangeLog 2007-10-16 17:54:48 UTC (rev 7120)
+++ trunk/bootscripts/ChangeLog 2007-10-21 16:33:30 UTC (rev 7121)
@@ -1,3 +1,9 @@
+2007-10-21 Dan Nicholson <[EMAIL PROTECTED]>
+       * Fixed the samba and sshd scripts to reference the pid files in
+         /var/run. This ensures that the correct processes are killed and
+         queried. Also changed the dbus script to use the pid file in the
+         status target, too.
+
 2007-08-22 DJ Lucas <[EMAIL PROTECTED]>
        * Updated the dhcpcd service script to comply with dhcpcd-3.0.19+.
 

Modified: trunk/bootscripts/blfs/init.d/dbus
===================================================================
--- trunk/bootscripts/blfs/init.d/dbus  2007-10-16 17:54:48 UTC (rev 7120)
+++ trunk/bootscripts/blfs/init.d/dbus  2007-10-21 16:33:30 UTC (rev 7121)
@@ -33,7 +33,7 @@
                 ;;
 
         status)
-                statusproc /usr/bin/dbus-daemon
+                statusproc -p $pidfile /usr/bin/dbus-daemon
                 ;;
 
         *)

Modified: trunk/bootscripts/blfs/init.d/samba
===================================================================
--- trunk/bootscripts/blfs/init.d/samba 2007-10-16 17:54:48 UTC (rev 7120)
+++ trunk/bootscripts/blfs/init.d/samba 2007-10-21 16:33:30 UTC (rev 7121)
@@ -10,29 +10,32 @@
 . /etc/sysconfig/rc
 . $rc_functions
 
+smbdpid=/var/run/smbd.pid
+nmbdpid=/var/run/nmbd.pid
+
 case "$1" in
        start)
                boot_mesg "Starting nmbd..."
-               loadproc /usr/sbin/nmbd -D
+               loadproc -p $nmbdpid /usr/sbin/nmbd -D
 
                boot_mesg "Starting smbd..."
-               loadproc /usr/sbin/smbd -D
+               loadproc -p $smbdpid /usr/sbin/smbd -D
                ;;
 
        stop)
                boot_mesg "Stopping smbd..."
-               killproc /usr/sbin/smbd
+               killproc -p $smbdpid /usr/sbin/smbd
 
                boot_mesg "Stopping nmbd..."
-               killproc /usr/sbin/nmbd
+               killproc -p $nmbdpid /usr/sbin/nmbd
                 ;;
 
        reload)
                boot_mesg "Reloading smbd..."
-               reloadproc /usr/sbin/smbd
+               reloadproc -p $smbpid /usr/sbin/smbd
 
                boot_mesg "Reloading nmbd..."
-               reloadproc /usr/sbin/nmbd
+               reloadproc -p $nmbdpid /usr/sbin/nmbd
                ;;
 
        restart)
@@ -42,8 +45,8 @@
                ;;
 
        status)
-               statusproc /usr/sbin/nmbd
-               statusproc /usr/sbin/smbd
+               statusproc -p $nmbdpid /usr/sbin/nmbd
+               statusproc -p $smbdpid /usr/sbin/smbd
                ;;
 
        *)

Modified: trunk/bootscripts/blfs/init.d/sshd
===================================================================
--- trunk/bootscripts/blfs/init.d/sshd  2007-10-16 17:54:48 UTC (rev 7120)
+++ trunk/bootscripts/blfs/init.d/sshd  2007-10-21 16:33:30 UTC (rev 7121)
@@ -10,23 +10,25 @@
 . /etc/sysconfig/rc
 . $rc_functions
 
+pidfile=/var/run/sshd.pid
+
 case "$1" in
     start)
         boot_mesg "Starting SSH Server..."
         # Also prevent ssh from being killed by out of memory conditions
-        loadproc /usr/sbin/sshd 
+        loadproc -p $pidfile /usr/sbin/sshd
         sleep 1
-        echo "-16" >/proc/`cat /var/run/sshd.pid`/oom_adj
+        echo "-16" >/proc/`cat $pidfile`/oom_adj
         ;;
 
     stop)
         boot_mesg "Stopping SSH Server..."
-        killproc /usr/sbin/sshd
+        killproc -p $pidfile /usr/sbin/sshd
         ;;
 
     reload)
         boot_mesg "Reloading SSH Server..."
-        reloadproc /usr/sbin/sshd
+        reloadproc -p $pidfile /usr/sbin/sshd
         ;;
 
     restart)
@@ -36,7 +38,7 @@
         ;;
 
     status)
-        statusproc /usr/sbin/sshd
+        statusproc $pidfile /usr/sbin/sshd
         ;;
 
     *)

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to