summaryrefslogtreecommitdiffstats
path: root/contrib/amd/scripts/ctl-amd.in
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2007-12-05 15:48:03 +0000
committerobrien <obrien@FreeBSD.org>2007-12-05 15:48:03 +0000
commitea691ecd980d2860f0b39e9e504de4da404806fd (patch)
treefa83b3bb0660890a21b550fa1f334b151bf098f9 /contrib/amd/scripts/ctl-amd.in
parentc06a2e613662fc6ce10145b41762be8f8ab22ba4 (diff)
downloadFreeBSD-src-ea691ecd980d2860f0b39e9e504de4da404806fd.zip
FreeBSD-src-ea691ecd980d2860f0b39e9e504de4da404806fd.tar.gz
Virgin import of AMD (am-utils) v6.1.5
Sponsored by: Juniper Networks
Diffstat (limited to 'contrib/amd/scripts/ctl-amd.in')
-rwxr-xr-xcontrib/amd/scripts/ctl-amd.in32
1 files changed, 18 insertions, 14 deletions
diff --git a/contrib/amd/scripts/ctl-amd.in b/contrib/amd/scripts/ctl-amd.in
index ffd696d..694b31a 100755
--- a/contrib/amd/scripts/ctl-amd.in
+++ b/contrib/amd/scripts/ctl-amd.in
@@ -2,12 +2,12 @@
# control starting, stopping, or restarting amd.
# usage: ctl-amd [start|stop|status|restart|condrestart|reload]
#
-# Package: am-utils-6.0
+# Package: am-utils-6.x
# Author: Erez Zadok <ezk@cs.columbia.edu>
#
# chkconfig: - 72 28
# description: Runs the automount daemon that mounts devices and NFS hosts \
-# on demand.
+# on demand.
# processname: amd
# config: /etc/amd.conf
#
@@ -60,16 +60,20 @@ fi
return 1
}
+# before running any real programs, chdir to / to avoid possible hangs on
+# (NFS) mounts which may be restarting.
+cd /
+
# search for amd.conf file
-CF_FILE="${prefix}/etc/amd.conf"
+CF_FILE="@sysconfdir@/amd.conf"
# any local copy of the conf file overrides the "global" one
if [ -f /etc/amd.conf ]
then
CF_FILE="/etc/amd.conf"
fi
-if [ -f ${prefix}/etc/amd.conf ]
+if [ -f @sysconfdir@/amd.conf ]
then
- CF_FILE="${prefix}/etc/amd.conf"
+ CF_FILE="@sysconfdir@/amd.conf"
fi
if [ -f /etc/local/amd.conf ]
then
@@ -99,7 +103,7 @@ case "$1" in
echo "killing amd..."
killproc " amd"
wait4amd2die
- test -f /var/lock/subsys/amd && rm -f /var/lock/subsys/amd
+ rm -f /var/lock/subsys/amd
;;
'restart')
@@ -117,14 +121,14 @@ case "$1" in
'condrestart')
if [ -f /var/lock/subsys/amd ]; then
- ctl-amd stop
- ctl-amd start
- fi
+ ctl-amd stop
+ ctl-amd start
+ fi
;;
'reload')
- amq -f
- ;;
+ amq -f
+ ;;
'status')
# run amq -v to produce status
@@ -139,13 +143,13 @@ case "$1" in
# start_msg and stop_msg are for HPUX
'start_msg')
- echo "Start am-utils 6.0 automounter"
+ echo "Start am-utils 6.1 automounter"
;;
'stop_msg')
- echo "Stop am-utils 6.0 automounter"
+ echo "Stop am-utils 6.1 automounter"
;;
*)
- echo "Usage: @sbindir@/ctl-amd [start|stop|status|restart|condrestart|reload]"
+ echo "Usage: $0 [start|stop|status|restart|condrestart|reload]"
;;
esac
OpenPOWER on IntegriCloud