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
|
2009-06-01 04:55:13 +00:00
|
|
|
# REQUIRE: rpcbind ypset nfsclient cleanvar 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"
|
2002-06-13 22:14:37 +00:00
|
|
|
rcvar=`set_rcvar`
|
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
|
|
|
{
|
2004-01-17 10:40:45 +00:00
|
|
|
if ! checkyesno nfs_client_enable; then
|
|
|
|
force_depend nfsclient || return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! checkyesno rpcbind_enable && \
|
|
|
|
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend rpcbind || return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
2001-06-16 07:16:14 +00:00
|
|
|
run_rc_command "$1"
|