tags 567805 + patch
retitle 567805 autofs5: Please use lsb output functions in init.d/autofs
thanks
Here is a tested patch implementing this change. The package will
need to depend on lsb-base too to get this working. Please include
the patch in the next upload and try to get it into Squeeze.
Happy hacking,
--
Petter Reinholdtsen
--- /etc/init.d/autofs.orig 2010-02-27 10:07:55.000000000 +0100
+++ /etc/init.d/autofs 2010-02-27 10:14:33.000000000 +0100
@@ -31,6 +31,8 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH
+. /lib/lsb/init-functions
+
#
# load customized configuation settings
#
@@ -39,7 +41,7 @@
fi
function start() {
- echo -n "Starting $prog: "
+ log_action_begin_msg "Starting $prog" "$prog"
# Make sure autofs4 module is loaded
if ! grep -q autofs /proc/filesystems
@@ -48,14 +50,13 @@
modprobe $MODULE >/dev/null 2>&1
if [ $? -eq 1 ]
then
- echo "Error: failed to load autofs4 module."
+ log_action_end_msg 1 "failed to load autofs4 module"
return 1
fi
elif ([ -f /proc/modules ] && lsmod) | grep -q autofs[^4]
then
# wrong autofs filesystem module loaded
- echo
- echo "Error: autofs kernel module is loaded, autofs4 required"
+ log_action_end_msg 1 "autofs kernel module is loaded, autofs4
required"
return 1
fi
@@ -80,15 +81,15 @@
start-stop-daemon --start --exec $DAEMON --oknodo -- $OPTIONS
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
- echo "done."
+ log_end_msg 0
else
- echo "no valid automount entries defined."
+ log_action_end_msg 1 "no valid automount entries defined."
fi
return 0
}
function stop() {
- echo -n $"Stopping $prog: "
+ log_action_begin_msg $"Stopping $prog: "
count=0
while [ -n "`pidof $DAEMON`" -a $count -lt 15 ] ; do
start-stop-daemon --stop --exec $DAEMON --oknodo
@@ -97,10 +98,10 @@
done
if [ -z "`pidof $DAEMON`" ] ; then
RETVAL=0
- echo "done."
+ log_action_end_msg 0
else
RETVAL=1
- echo "failed."
+ log_action_end_msg 1
fi
return $RETVAL
}
@@ -113,11 +114,11 @@
function reload() {
pid=`pidof $DAEMON`
if [ -z $pid ]; then
- echo $"$prog not running"
+ log_action_msg $"$prog not running"
RETVAL=1
else
kill -HUP $pid 2> /dev/null
- echo $"Reloading maps"
+ log_action_msg $"Reloading maps"
RETVAL=0
fi
return $RETVAL