3
# rc file for automount using a Sun-style "master map".
6
# processname: /usr/sbin/automount
7
# config: /etc/auto.master
8
# description: Automounts filesystems on demand
12
# Required-Start: $network $ypbind
13
# Required-Stop: $network $ypbind
14
# Default-Start: 3 4 5
15
# Default-Stop: 0 1 2 6
16
# Short-Description: Automounts filesystems on demand
17
# Description: Automounts filesystems on demand
20
# Location of the automount daemon and the init directory
22
DAEMON=@@sbindir@@/automount
23
prog=`basename $DAEMON`
27
confdir=@@autofsconfdir@@
29
test -e $DAEMON || exit 0
31
if [ -r $initdir/functions ]; then
35
PATH=/sbin:/usr/sbin:/bin:/usr/bin
39
# load customized configuation settings
41
if [ -r $confdir/autofs ]; then
46
# Make sure autofs4 module is loaded
47
if ! grep -q autofs /proc/filesystems
49
echo -n "Loading $MODULE: "
50
# Try load the autofs4 module fail if we can't
51
modprobe $MODULE >/dev/null 2>&1
55
failure "Load $MODULE"
59
success "Load $MODULE"
62
elif ([ -f /proc/modules ] && lsmod) | grep -q autofs[^4]
65
failure "Load $MODULE"
71
if [ -n "$USE_MISC_DEVICE" -a "x$USE_MISC_DEVICE" = "xyes" ]; then
73
if [ -e "/proc/misc" ]; then
74
MINOR=`awk "/$DEVICE/ {print \\$1}" /proc/misc`
75
if [ -n "$MINOR" -a ! -c "/dev/$DEVICE" ]; then
76
mknod -m 0600 /dev/$DEVICE c 10 $MINOR
79
if [ -x /sbin/restorecon -a -c /dev/$DEVICE ]; then
80
/sbin/restorecon /dev/$DEVICE
83
if [ -c /dev/$DEVICE ]; then
88
echo -n $"Starting $prog: "
89
$prog $OPTIONS --pid-file /var/run/autofs.pid
91
if [ $RETVAL -eq 0 ] ; then
92
success "$prog startup"
94
failure "$prog startup"
96
if [ $RETVAL -eq 0 ]; then
97
touch /var/lock/subsys/autofs
106
echo -n $"Stopping $prog: "
108
while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
109
killproc $prog -TERM >& /dev/null
111
[ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3
112
count=`expr $count + 1`
114
if [ $RETVAL -eq 0 ]; then
115
rm -f /var/lock/subsys/autofs
119
if [ -n "`pidof $prog`" ] ; then
120
failure "$prog shutdown"
122
success "$prog shutdown"
129
status autofs > /dev/null 2>&1
130
if [ $? -eq 0 ]; then
137
if [ ! -f /var/lock/subsys/autofs ]; then
138
echo $"$prog not running"
144
echo $"$prog not running"
147
kill -HUP $pid 2> /dev/null
148
echo $"Reloading maps"
156
# Only the root user may change the service status
157
if [ `id -u` -ne 0 ]; then
158
echo "insufficient privilege to change service status"
167
OPTIONS="$OPTIONS --force"
174
status -p /var/run/autofs.pid -l autofs $prog
180
OPTIONS="$OPTIONS --force"
187
if [ -f /var/lock/subsys/autofs ]; then
192
echo $"Usage: $0 {start|forcestart|stop|status|restart|forcerestart|reload|condrestart}"
195
try-restart|force-reload)
196
echo "$1 service action not supported"
200
echo "unknown, invalid or excess argument(s)"