2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: amd
|
2012-09-11 05:04:59 +00:00
|
|
|
# REQUIRE: rpcbind ypset nfsclient FILESYSTEMS ldconfig
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: DAEMON
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="amd"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="amd_enable"
|
2002-06-21 19:50:01 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2004-01-17 10:40:45 +00:00
|
|
|
start_precmd="amd_precmd"
|
|
|
|
command_args="&"
|
2006-10-18 15:56:11 +00:00
|
|
|
extra_commands="reload"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2002-10-12 10:31:31 +00:00
|
|
|
amd_precmd()
|
2002-06-13 22:14:37 +00:00
|
|
|
{
|
2012-02-14 10:51:24 +00:00
|
|
|
force_depend nfsclient nfs_client || return 1
|
|
|
|
force_depend rpcbind || return 1
|
2004-01-17 10:40:45 +00:00
|
|
|
|
|
|
|
case ${amd_map_program} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
*)
|
2007-10-19 22:55:42 +00:00
|
|
|
rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`"
|
2004-01-17 10:40:45 +00:00
|
|
|
;;
|
|
|
|
esac
|
2002-06-20 08:49:44 +00:00
|
|
|
|
2004-01-17 10:40:45 +00:00
|
|
|
case "${amd_flags}" in
|
|
|
|
'')
|
|
|
|
if [ ! -r /etc/amd.conf ]; then
|
|
|
|
warn 'amd will not load without arguments'
|
|
|
|
return 1
|
2002-06-13 22:14:37 +00:00
|
|
|
fi
|
2004-01-17 10:40:45 +00:00
|
|
|
;;
|
|
|
|
*)
|
2007-10-19 22:55:42 +00:00
|
|
|
rc_flags="-p ${rc_flags}"
|
2007-10-25 16:59:06 +00:00
|
|
|
command_args="> /var/run/amd.pid 2> /dev/null"
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
2001-06-16 07:16:14 +00:00
|
|
|
run_rc_command "$1"
|