diff options
author | mtm <mtm@FreeBSD.org> | 2007-05-17 08:57:14 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2007-05-17 08:57:14 +0000 |
commit | 4a87da8d3e5820efee94157a7088e9ae98000815 (patch) | |
tree | d2cb34300aac7c168c6314cb72044839a0d287ae /etc/rc.d/statd | |
parent | 94835f6f0dee5592b25eea8d9564637d7d138223 (diff) | |
download | FreeBSD-src-4a87da8d3e5820efee94157a7088e9ae98000815.zip FreeBSD-src-4a87da8d3e5820efee94157a7088e9ae98000815.tar.gz |
The precmd routine does not need to check whether the command should be
"forced". If some pre-condition is not met, it should fail as it normally
does and rc.subr(8) will make the appropriate decision. Incidentally, the
previous behaviour had a bug where the "force" flag was respected only
when checking rc.conf(5) knobs. The flag was ignored when verifying the
rpcbind(8) dependency.
MFC after: 2 weeks
Diffstat (limited to 'etc/rc.d/statd')
-rw-r--r-- | etc/rc.d/statd | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/rc.d/statd b/etc/rc.d/statd index 02b6b20..e5b2c8c 100644 --- a/etc/rc.d/statd +++ b/etc/rc.d/statd @@ -14,20 +14,21 @@ # Save the (one) commandline argument in case it gets clobbered. arg=$1 -# Either NFS client or server must be enabled or this must be a 'forcestart' -# for either of the daemons to start. +# Either NFS client or server must be enabled and rpcbind(8) must be started. # nfslocking_precmd() { - if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable && \ - [ -z "$rc_force" ] + local ret + ret=0 + + if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable then - return 1 + ret=1 fi if ! checkyesno rpcbind_enable && \ ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 then - force_depend rpcbind || return 1 + force_depend rpcbind || ret=1 fi if [ $name = "statd" ] @@ -37,11 +38,12 @@ nfslocking_precmd() then rc_flags=${rpc_lockd_flags} fi + + return ${ret} } start_precmd="nfslocking_precmd" -stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable || - [ -n "$rc_force" ]' +stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable' status_precmd=$stop_precmd # rpc.statd |