3 # Author: iSteve <isteve@bofh.cz>
5 # Note that this script is untested!
7 # PATH should only include /usr/* if it runs after the mountnfs.sh script
12 DAEMON_ARGS
="--coldplug --persistent"
13 PIDFILE
=/var
/run
/$NAME.pid
14 SCRIPTNAME
=/etc
/init.d
/$NAME
16 # Load the VERBOSE setting and other rcS variables
17 [ -f /etc
/default
/rcS
] && .
/etc
/default
/rcS
19 # Define LSB log_* functions.
20 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
21 .
/lib
/lsb
/init-functions
24 # Function that starts the daemon/service
28 start-stop-daemon
--start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev
/null \
30 start-stop-daemon
--start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
36 # Function that stops the daemon/service
40 start-stop-daemon
--stop --quiet --retry=TERM
/30/KILL
/5 --pidfile $PIDFILE --name $NAME
42 [ "$RETVAL" = 2 ] && return 2
44 start-stop-daemon
--stop --quiet --oknodo --retry=0/30/KILL
/5 --exec $DAEMON
45 [ "$?" = 2 ] && return 2
46 # Many daemons don't delete their pidfiles when they exit.
53 [ "$VERBOSE" != no
] && log_daemon_msg
"Starting $DESC" "$NAME"
61 echo "/sbin/hotplug2-dnode" > /proc
/sys
/kernel
/hotplug
62 DAEMON_ARGS
=${DAEMON_ARGS}" --set-coldplug-cmd /sbin/hotplug2-coldplug-2.4"
65 # 2.6 needs no extra flags
71 0|
1) [ "$VERBOSE" != no
] && log_end_msg
0 ;;
72 2) [ "$VERBOSE" != no
] && log_end_msg
1 ;;
76 [ "$VERBOSE" != no
] && log_daemon_msg
"Stopping $DESC" "$NAME"
79 0|
1) [ "$VERBOSE" != no
] && log_end_msg
0 ;;
80 2) [ "$VERBOSE" != no
] && log_end_msg
1 ;;
84 echo "Usage: $SCRIPTNAME {start|stop}" >&2