2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: amd,v 1.10 2002/04/29 12:08:17 lukem Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: amd
|
2005-01-16 03:12:03 +00:00
|
|
|
# REQUIRE: rpcbind ypbind nfsclient cleanvar
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: DAEMON
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
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="&"
|
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] | '')
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
rc_flags="${rc_flags} `eval ${amd_map_program}`"
|
|
|
|
;;
|
|
|
|
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
|
|
|
;;
|
|
|
|
*)
|
2005-12-30 08:57:33 +00:00
|
|
|
rc_flags="-p ${rc_flags} > /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"
|