[Initng-svn] r2368 - initng

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Dec 8 13:46:18 CET 2005


Author: danne
Date: Thu Dec  8 13:46:16 2005
New Revision: 2368

Modified:
   initng/gen_system_runlevel
Log:
Add some scanning of SysVinit services to system.runlevel as well


Modified: initng/gen_system_runlevel
==============================================================================
--- initng/gen_system_runlevel	(original)
+++ initng/gen_system_runlevel	Thu Dec  8 13:46:16 2005
@@ -23,16 +23,19 @@
 
 #See comment above
 #Usage: Send sysvinit runlevel as first argument. The function will scan through
-#the runlevel and add all started services to initng's default.runlevel
+#the runlevel and add all started services to initng's runlevels (depending
+#on the second argument, which is normally "default" or "system". The third
+#argument is the directory in which to check if the initng service exists,
+#this would normally be "daemon" or "system"
 copy_sysvinit_services() {
   if [ -d /etc/rc${1}.d ]; then
     for i in /etc/rc${1}.d/S* ; do
       sname=`basename $i`
       sname=${sname##S[0-9][0-9]}
-      if [ -f /etc/initng/daemon/${sname}.i ]; then
-        grep "daemon/${sname}" ${DESTDIR}/etc/initng/default.runlevel > /dev/null
+      if [ -f /etc/initng/${3}/${sname}.i ]; then
+        grep "${3}/${sname}" ${DESTDIR}/etc/initng/${2}.runlevel > /dev/null
         if [ $? -ne 0 ]; then
-          echo "daemon/${sname}" >> ${DESTDIR}/etc/initng/default.runlevel
+          echo "${3}/${sname}" >> ${DESTDIR}/etc/initng/${2}.runlevel
         fi
       fi
     done
@@ -114,6 +117,9 @@
 else
   echo "Failed to find getty/agetty/mingetty, you must set that manually in /etc/initng/system.runlevel"
 fi
+
+get_default_sysvinit_runlevel
+copy_sysvinit_services $? "system" "system"
 }
 
 gen_default() {
@@ -242,7 +248,7 @@
 #If/when this works on all other thistros, we should be able to obsolete some
 #of the crap above. /Daniel
 get_default_sysvinit_runlevel
-copy_sysvinit_services $?
+copy_sysvinit_services $? "default" "daemon"
 }
 
 echo "Automatically generating system,runlevel and default.runlevel"


More information about the Initng-svn mailing list