6 # Required-Start: $network $remote_fs $syslog
7 # Required-Stop: $network $remote_fs $syslog
8 # Should-Start: ypbind nslcd slapd
9 # Should-Stop: ypbind nslcd slapd
10 # Default-Start: 2 3 4 5
12 # Short-Description: Automounts filesystems on demand
13 # Description: Automounts filesystems on demand
16 # Location of the automount daemon and the init directory
19 DAEMON=/usr/sbin/$PROG
21 PIDFILE="/var/run/$NAME.pid"
23 test -e $DAEMON || exit 0
25 PATH=/sbin:/usr/sbin:/bin:/usr/bin
29 # load customized configuation settings
31 if [ -r /etc/default/autofs ]; then
36 start-stop-daemon "$@" --pidfile $PIDFILE --exec $DAEMON -- \
37 $OPTIONS --pid-file $PIDFILE
41 echo -n "Starting $PROG..."
43 if ! grep -qw autofs /proc/filesystems
45 if ! modprobe autofs4 >/dev/null 2>&1
47 echo "failed (failed to load autofs4 module)."
50 elif [ -f /proc/modules ] && grep -q "^autofs[^4]" /proc/modules
52 echo "failed (autofs kernel module is loaded, autofs4 required)."
56 if ! start_stop_autofs --start --oknodo --quiet ; then
57 echo "failed (no valid automount entries defined)."
65 echo -n "Stopping $PROG..."
66 if ! start_stop_autofs --stop --retry 5 --oknodo --quiet ; then
75 echo -n "Reloading $PROG maps..."
76 if ! start_stop_autofs --stop --signal=HUP --quiet
78 echo "failed ($PROG not running)."
86 OPTIONS="$OPTIONS --force"
91 start|forcestart|stop|reload)
103 echo "Usage: $0 {start|forcestart|stop|restart|forcerestart|reload|force-reload}"