/etc/init.d/functions patch

Caleb Land bokonon at rochester.rr.com
Wed Dec 13 07:54:06 PST 2000

	Firstly, let me state that LFS is an excellent project that
has both caused frustration and happiness (usually in that order :))

	Secondly, I was creating my own boot scripts for gpm and
devfsd and decided to use the functions which come in the functions
file for starting, stopping, and reloading the daemons.
	I found this bug when I was trying out the stop function to
which I specified a signal (I believe 2).  The script gave an error,
so I looked at the function and found that in the killproc function
you have to pass it an argument like -9 (note the dash), but to
reloadproc you don't (because the function puts it there for you).  I
don't know which behavior you want, but you most likely want it to be
consistant, so here is the patch to the LFS 2.4.3 functions file which
does not require the user to add a - to their scripts when specifying
signals.  Previously, the reloadproc function put two dashes in fron
of the signal number which is why the patch alters that funtion too.
	Hope this helps!
Caleb Land

Email: bokonon at rochester.rr.com

AIM:   RedHatDude
ICQ:   8358400

GnuPG/PGP Public Key: finger me at "caleb at deepthought.granfalloon.com"
                      and read my .plan.
-------------- next part --------------
--- functions	Wed Dec 13 10:29:09 2000
+++ functions.new	Wed Dec 13 10:46:00 2000
@@ -126,7 +126,7 @@
                                 print_status success
-                        /bin/kill $killlevel $pid
+                        /bin/kill -$killlevel $pid
                         /bin/ps h $pid >/dev/null 2>&1
                         if [ $? = 0 ]
@@ -153,7 +153,7 @@
         if [ -n "$2" ]
-                killlevel=-$2
+                killlevel=$2

More information about the lfs-dev mailing list