Hi,
I noticed some problems in the autofs rc script in 3.1.4-pre4. There's a
couple of problems:
- the Mandrake 6.0 (and I presume RedHat) shutdown scripts assume the files in
/var/lock/subsys have the same names as their corresponding scripts in
/etc/rc.d/init.d
- there's some bogus syntax
There's still another bug where it doesn't check to see if pidof returns
anything before running kill. The easiest fix is probably to use killproc
rather than kill `pidof ...`.
J
--- autofs-3.1.4/samples/rc.autofs.in Thu Jan 13 03:46:25 2000
+++ autofs-3.1.4-jsgf/samples/rc.autofs.in Tue Jan 18 01:26:08 2000
@@ -10,6 +10,11 @@
# /etc/rc.d/init.d/autofs or /etc/init.d/autofs
#
+# For Redhat-ish systems
+#
+# chkconfig: 345 15 85
+# description: Automounts filesystems on demand
+
# This is used in the Debian distribution to determine the proper
# location for the S- and K-links to this init file.
# The following value is extracted by debstd to figure out how to
@@ -44,7 +49,7 @@
test -e $DAEMON || exit 0
thisscript="$0"
-if [ ! test -f $thisscript ]; then
+if [ ! -f "$thisscript" ]; then
echo "$0: Cannot find myself" 1>&2
exit 1
fi
@@ -145,18 +150,18 @@
case "$1" in
start)
# Check if the automounter is already running?
- if [ ! -f /var/lock/subsys/automount ]; then
+ if [ ! -f /var/lock/subsys/autofs ]; then
echo 'Starting automounter: '
getmounts | sh
- touch /var/lock/subsys/automount
+ touch /var/lock/subsys/autofs
fi
;;
stop)
kill -TERM $(/sbin/pidof /usr/sbin/automount)
- rm -f /var/lock/subsys/automount
+ rm -f /var/lock/subsys/autofs
;;
reload|restart)
- if [ ! -f /var/lock/subsys/automount ]; then
+ if [ ! -f /var/lock/subsys/autofs ]; then
echo "Automounter not running"
exit 1
fi
@@ -204,7 +209,7 @@
getmounts | while read cmd mnt rest
do
echo -n " $mnt"
- pidfile=/var/run/automount`echo $mnt | sed 's/\//./'`.pid
+ pidfile=/var/run/autofs`echo $mnt | sed 's/\//./'`.pid
start-stop-daemon --start --pidfile $pidfile --quiet \
--exec $DAEMON -- $mnt $rest
#
@@ -225,9 +230,9 @@
;;
reload|restart)
echo "Reloading automounter: checking for changes ... "
- TMP=/var/run/automount.tmp
+ TMP=/var/run/autofs.tmp
getmounts >$TMP
- for i in /var/run/automount.*.pid
+ for i in /var/run/autofs.*.pid
do
pid=`head -n 1 $i 2>/dev/null`
[ "$pid" = "" ] && continue