6 # description: Runs the automount daemon that mounts devices and NFS hosts \
9 # config: /etc/amd.conf
12 # we require the /etc/amd.conf file
13 [ -f /etc/amd.conf ] || exit 0
14 [ -f /etc/sysconfig/amd ] || exit 0
16 # Source function library.
17 . /etc/init.d/functions
19 # Recover AMDOPTS from /etc/sysconfig/amd.
20 if [ -f /etc/sysconfig/amd ] ; then
27 exec_prefix=@exec_prefix@
31 echo -n "Starting $prog: "
32 daemon $amd -F /etc/amd.conf $AMDOPTS $OPTIONS $MOUNTPTS
35 [ $RETVAL = 0 ] && touch /var/lock/subsys/amd
41 echo -n "Stopping $prog: "
42 # modeled from /usr/sbin/ctl-amd
43 pid=`/usr/sbin/amq -p 2>/dev/null`
44 if [ "$pid" = "" ] ; then
45 # amq -p did not give pid, so try ps
46 pid=`ps acx 2>/dev/null | grep "amd" | sed -e 's/^ *//' -e 's/ .*//'`
48 if [ "$pid" = "" ] ; then
49 failure "amd shutdown pid"
54 # and this part is from wait4amd2die
58 maxcount=`expr $count + 1`
59 while [ $i != $maxcount ]; do
61 /usr/sbin/amq > /dev/null 2>&1
64 # amq failed to run (because amd is dead)
65 success "amd shutdown"
66 rm -f /var/lock/subsys/amd
73 failure "amd shutdown (still up)"
77 # See how we were called.
93 if [ -f /var/lock/subsys/amd ]; then
99 action "Reloading $prog:" killall -HUP $amd
102 echo "Usage: $0 {start|stop|restart|reload|condrestart|status}"