Revision  Path
	  1.82      src/etc/rc.d/Makefile
	  1.16      src/etc/rc.d/lockd
	  1.17      src/etc/rc.d/lockd
	  1.18      src/etc/rc.d/lockd
	  1.15      src/etc/rc.d/nfslocking
	  1.16      src/etc/rc.d/statd
	  1.17      src/etc/rc.d/statd

	Split rc.d/nfslocking into two separate scripts: rc.d/lockd
	and rc.d/statd. Keep rc.d/nfslocking for POLA reasons but do
	not run it during system startup.

	PR: conf/107316

	  Revision  Path
	  1.14      src/etc/rc.d/nfslocking

	The precmd routine does not need to check whether the comman
	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.
This commit is contained in:
mtm 2007-09-26 11:02:28 +00:00
parent 4b73c7f73d
commit 85a486d312
2 changed files with 13 additions and 11 deletions

View File

@ -19,7 +19,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
ipnat ipsec ipxrouted isdnd \
jail \
kadmind kerberos keyserv kldxref kpasswdd \
ldconfig local localpkg lpd \
ldconfig local localpkg lockd lpd \
mixer motd mountcritlocal mountcritremote mountlate \
mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \
named natd netif netoptions \
@ -32,7 +32,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
ramdisk ramdisk-own random rarpd resolv root \
route6d routed routing rpcbind rtadvd rwho \
savecore sdpd securelevel sendmail \
serial sppp swap1 \
serial sppp statd swap1 \
syscons sysctl syslogd \
timed tmp \
ugidfw usbd \

View File

@ -7,27 +7,28 @@
# PROVIDE: nfslocking
# REQUIRE: nfsserver nfsclient nfsd rpcbind
# BEFORE: DAEMON
# KEYWORD: nojail
# KEYWORD: nojail nostart
. /etc/rc.subr
# 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