20ceedfb69
1. Add new functionality to the force_depend method to incorporate the tests for whether the service is enabled and/or already running. 2. Add a new option to bypass checking only that the service is enabled at boot time, and always check if it is running. 3. Use this new functionality to greatly simplify the rc.d scripts that use force_depend. 4. Add a force_depend for statd in lockd 5. Remove the check that either nfs_server or nfs_client is _enable'd from statd and lockd. This was always overkill, and prevented using the {one|force}start options, as well as stop'ing on the command line. 6. The yp* scripts had some of their arguments in various weird orders. Bring them into line with the model. 7. If mountd fails to create /var/db/mountdtab, err out. Ideas, suggestions, and/or review from delphij and jilles. Pointy hats are completely my responsibility however.
49 lines
770 B
Bash
Executable File
49 lines
770 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: amd
|
|
# REQUIRE: rpcbind ypset nfsclient cleanvar ldconfig
|
|
# BEFORE: DAEMON
|
|
# KEYWORD: nojail shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="amd"
|
|
rcvar="amd_enable"
|
|
command="/usr/sbin/${name}"
|
|
start_precmd="amd_precmd"
|
|
command_args="&"
|
|
extra_commands="reload"
|
|
|
|
amd_precmd()
|
|
{
|
|
force_depend nfsclient nfs_client || return 1
|
|
force_depend rpcbind || return 1
|
|
|
|
case ${amd_map_program} in
|
|
[Nn][Oo] | '')
|
|
;;
|
|
*)
|
|
rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`"
|
|
;;
|
|
esac
|
|
|
|
case "${amd_flags}" in
|
|
'')
|
|
if [ ! -r /etc/amd.conf ]; then
|
|
warn 'amd will not load without arguments'
|
|
return 1
|
|
fi
|
|
;;
|
|
*)
|
|
rc_flags="-p ${rc_flags}"
|
|
command_args="> /var/run/amd.pid 2> /dev/null"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|