r8420 - in trunk/bootscripts/contrib/lsb-v3: . blfs/init.d

dj at linuxfromscratch.org dj at linuxfromscratch.org
Tue Apr 27 19:35:07 PDT 2010


Author: dj
Date: 2010-04-27 20:35:07 -0600 (Tue, 27 Apr 2010)
New Revision: 8420

Added:
   trunk/bootscripts/contrib/lsb-v3/blfs/init.d/netfs
   trunk/bootscripts/contrib/lsb-v3/blfs/init.d/random
Modified:
   trunk/bootscripts/contrib/lsb-v3/Makefile
   trunk/bootscripts/contrib/lsb-v3/blfs/init.d/alsa
   trunk/bootscripts/contrib/lsb-v3/blfs/init.d/cups
   trunk/bootscripts/contrib/lsb-v3/blfs/init.d/gdm
   trunk/bootscripts/contrib/lsb-v3/blfs/init.d/samba
Log:
fixed deps, added random and netfs

Modified: trunk/bootscripts/contrib/lsb-v3/Makefile
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/Makefile	2010-04-28 01:27:29 UTC (rev 8419)
+++ trunk/bootscripts/contrib/lsb-v3/Makefile	2010-04-28 02:35:07 UTC (rev 8420)
@@ -24,10 +24,6 @@
 	install -m ${MODE} blfs/init.d/alsa       ${EXTDIR}/init.d/
 	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/alsa
 
-install-named: create-dirs
-	install -m ${MODE} blfs/init.d/named       ${EXTDIR}/init.d/
-	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/named
-
 install-cups: create-dirs
 	install -m ${MODE} blfs/init.d/cups       ${EXTDIR}/init.d/
 	rm -f ${EXTDIR}/rc0.d/K36cups
@@ -63,10 +59,18 @@
 	install -m ${MODE} blfs/init.d/httpd     ${EXTDIR}/init.d/
 	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/httpd
 
+install-named: create-dirs
+	install -m ${MODE} blfs/init.d/named       ${EXTDIR}/init.d/
+	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/named
+
 install-nas: create-dirs
 	install -m ${MODE} blfs/init.d/nas        ${EXTDIR}/init.d/
 	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/nas
 
+install-netfs: create-dirs
+	install -m ${MODE} blfs/init.d/netfs      ${EXTDIR}/init.d/
+	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/netfs
+
 install-ntpd: create-dirs
 	install -m ${MODE} blfs/init.d/ntpd       ${EXTDIR}/init.d/
 	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/ntpd
@@ -79,6 +83,10 @@
 	install -m ${MODE} blfs/init.d/postfix    ${EXTDIR}/init.d/
 	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/postfix
 
+install-random: create-dirs
+	install -m ${MODE} blfs/init.d/random     ${EXTDIR}/init.d/
+	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/random
+
 install-samba: create-dirs
 	install -m ${MODE} blfs/init.d/samba      ${EXTDIR}/init.d/
 	/usr/lib/lsb/install_initd ${EXTDIR}/init.d/samba

Modified: trunk/bootscripts/contrib/lsb-v3/blfs/init.d/alsa
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/blfs/init.d/alsa	2010-04-28 01:27:29 UTC (rev 8419)
+++ trunk/bootscripts/contrib/lsb-v3/blfs/init.d/alsa	2010-04-28 02:35:07 UTC (rev 8420)
@@ -4,16 +4,14 @@
 ### BEGIN INIT INFO
 # Provides:            alsa
 # Required-Start:      
-# Should-Start:
+# Should-Start:        
 # Required-Stop:       $network
-# Should-Stop:         $remote_fs
+# Should-Stop:         $remote_fs haldaemon dbus
 # Default-Start:
-# Default-Stop:        0 6
+# Default-Stop:        0 1 2 6
 # Short-Description:   Saves the current volume of all sound channels.
 # Description:         Saves the current volume of all sound channels on
 #                      shutdown so that they can be restored on next boot.
-# X-LFS-Default-Start:
-# X-LFS-Default-Stop:  K35
 # X-LFS-Provided-By:   BLFS
 ### END INIT INFO
 

Modified: trunk/bootscripts/contrib/lsb-v3/blfs/init.d/cups
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/blfs/init.d/cups	2010-04-28 01:27:29 UTC (rev 8419)
+++ trunk/bootscripts/contrib/lsb-v3/blfs/init.d/cups	2010-04-28 02:35:07 UTC (rev 8420)
@@ -4,9 +4,9 @@
 ### BEGIN INIT INFO
 # Provides:            cups
 # Required-Start:      $network
-# Should-Start:        $remote_fs
+# Should-Start:        $remote_fs haldaemon
 # Required-Stop:       $network
-# Should-Stop:         $remote_fs
+# Should-Stop:         $remote_fs haldaemon samba
 # Default-Start:       3 4 5 
 # Default-Stop:        0 1 2 6
 # Short-Description:   Starts/Stops the Common UNIX Printing System.

Modified: trunk/bootscripts/contrib/lsb-v3/blfs/init.d/gdm
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/blfs/init.d/gdm	2010-04-28 01:27:29 UTC (rev 8419)
+++ trunk/bootscripts/contrib/lsb-v3/blfs/init.d/gdm	2010-04-28 02:35:07 UTC (rev 8420)
@@ -2,11 +2,11 @@
 # Begin /etc/init.d/gdm
 
 ### BEGIN INIT INFO
-# Provides:            gpm
-# Required-Start:      $network dbus
-# Should-Start:        $remote_fs
-# Required-Stop:       $network dbus
-# Should-Stop:         $remote_fs
+# Provides:            gdm
+# Required-Start:      $network
+# Should-Start:        alsa cups haldaemon $remote_fs samba sshd
+# Required-Stop:       $network
+# Should-Stop:         alsa cups haldaemon $remote_fs samba sshd
 # Default-Start:       5
 # Default-Stop:        0 1 2 3 4 6
 # Short-Description:   Starts/Stops the Gnome Display Manager (GUI Login). 

Added: trunk/bootscripts/contrib/lsb-v3/blfs/init.d/netfs
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/blfs/init.d/netfs	                        (rev 0)
+++ trunk/bootscripts/contrib/lsb-v3/blfs/init.d/netfs	2010-04-28 02:35:07 UTC (rev 8420)
@@ -0,0 +1,99 @@
+#!/bin/sh
+# Begin /etc/init.d/netfs
+
+### BEGIN INIT INFO
+# Provides:            $remote_fs
+# Required-Start:      $network
+# Should-Start:
+# Required-Stop:       $network
+# Should-Stop:         
+# Default-Start:       3 4 5
+# Default-Stop:        0 1 2 6
+# Short-Description:   Starts/Stops the Gnome Display Manager (GUI Login). 
+# Description:         Starts and stops the Gnome Display Manager.
+# X-LFS-Provided-By:   BLFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+case "$1" in
+    start)
+        # The following line mounts all entries in fstab that
+        # have the _netdev option.  This is required for network
+        # filesystems to be mounted at boot time.
+        MESSAGE="Mounting network volumes..."
+        /bin/mount -a -O _netdev
+        evaluate_retval generic
+    ;;
+
+    stop)
+        MESSAGE="Unmounting network volumes..."
+        # The following line obtains a list from the output of
+        # mount for all netfs types and anything that was
+        # mounted with the _netdev option.
+        NETMOUNTS=`/bin/mount \
+        | /bin/grep '_netdev\|smbfs\|ncpfs\|coda\|nfs' \
+        | /usr/bin/cut -d " " -f 3 | /bin/sed ':a;$!N;s/\n/ /;ta'`
+
+        # Check to see if anything was listed from above
+        # (see if anything is actually needs to be unmounted)
+        if [ x"$NETMOUNTS" != x ]
+        then
+            # There is something mounted
+            # terminate the echo -n above
+            echo ""
+
+            # Try and stop processes the nice way
+            # (probably won't work in most cases)
+            /bin/fuser -SIGTERM -km $NETMOUNTS > /dev/null
+
+            # Check and see if it found anything.  If it
+            # did, then give 3 seconds for things to exit
+            # the nice way before killing them off.
+            # This one will work all of the time!
+            if [ $? = 0 ]
+            then
+                /bin/sleep 3
+                /bin/fuser -km $NETMOUNTS > /dev/null
+            fi
+
+            # We now need to unmount all network filesystems.
+            # We will do this with two umount commands to allow
+            # for broken behavior of smbmount, and also to make
+            # certain that netmounts without the _netdev option
+            # will still get unmounted.
+            /bin/umount -af -O _netdev
+            # save the retval
+            if [ $? != 0 ]
+            then
+                NERRVAL=1
+            fi
+
+            # Now catch the rest of the network filesystems
+            # by fstype.  This list can be extended later as
+            # more network filesystems are supported by mount.
+            /bin/umount -af -t coda,ncpfs,nfs,smbfs
+            if [ $? = 0 ]
+            then
+                [ -z $NERRVAL ]
+                evaluate_retval generic
+            else
+                # make certain that we return an error
+                /bin/false              
+                evaluate_retval generic
+            fi
+        else
+            # There is nothing mounted
+            MESSAGE="${MESSAGE} No network volumes mounted!"
+            /bin/true
+            evaluate_retval generic
+        fi
+    ;;
+
+    *)
+        echo "Usage: $0 {start|stop}"
+        exit 1
+    ;;
+esac
+
+# End $rc_base/init.d/netfs

Added: trunk/bootscripts/contrib/lsb-v3/blfs/init.d/random
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/blfs/init.d/random	                        (rev 0)
+++ trunk/bootscripts/contrib/lsb-v3/blfs/init.d/random	2010-04-28 02:35:07 UTC (rev 8420)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Begin /etc/init.d/random
+
+### BEGIN INIT INFO
+# Provides:            random
+# Required-Start:
+# Should-Start:
+# Required-Stop:       $network
+# Should-Stop:
+# Default-Start:       1 2 3 4 5
+# Default-Stop:        0 6
+# Short-Description:   Loads/Saves the random seed. 
+# Description:         Loads/Saves teh random seed.
+# X-LFS-Provided-By:   BLFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+
+case "$1" in
+    start)
+        MESSAGE="Initializing kernel random number generator..."
+        if [ -f /var/tmp/random-seed ]; then
+            /bin/cat /var/tmp/random-seed >/dev/urandom
+        fi
+        /bin/dd if=/dev/urandom of=/var/tmp/random-seed \
+            count=1 &>/dev/null
+        evaluate_retval generic
+        ;;
+
+    stop)
+        MESSAGE="Saving random seed..."
+        /bin/dd if=/dev/urandom of=/var/tmp/random-seed \
+            count=1 &>/dev/null
+        evaluate_retval generic
+        ;;
+
+    *)
+        echo "Usage: $0 {start|stop}"
+        exit 1
+        ;;
+esac
+
+# End /etc/init.d/random

Modified: trunk/bootscripts/contrib/lsb-v3/blfs/init.d/samba
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/blfs/init.d/samba	2010-04-28 01:27:29 UTC (rev 8419)
+++ trunk/bootscripts/contrib/lsb-v3/blfs/init.d/samba	2010-04-28 02:35:07 UTC (rev 8420)
@@ -4,7 +4,7 @@
 ### BEGIN INIT INFO
 # Provides:            samba
 # Required-Start:      $network
-# Should-Start:        
+# Should-Start:        cups 
 # Required-Stop:       $network
 # Should-Stop:         $remote_fs
 # Default-Start:       3 4 5
@@ -12,8 +12,6 @@
 # Short-Description:   Provides SMB (Windows) networking.
 # Description:         Starts Samba smbd and nmbd processess which provide
 #                      connectivity to SMB (Windows) networks.
-# X-LFS-Default-Start: S45
-# X-LFS-Default-Stop:  K48
 # X-LFS-Provided-By:   BLFS
 ### END INIT INFO
 




More information about the blfs-book mailing list