Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)

variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
This commit is contained in:
lukem 2004-10-12 14:51:03 +00:00
parent 3c81b28a9a
commit 1ecb0d140f
9 changed files with 34 additions and 14 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: amd,v 1.12 2004/10/12 13:44:45 lukem Exp $
# $NetBSD: amd,v 1.13 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: amd
@ -22,4 +22,6 @@ required_files="/etc/amd.conf"
required_dirs="$amd_dir"
required_vars="rpcbind"
load_rc_config_var rpcbind rpcbind
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: ipnat,v 1.12 2004/10/11 15:00:51 christos Exp $
# $NetBSD: ipnat,v 1.13 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: ipnat
@ -36,4 +36,5 @@ ipnat_start()
}
load_rc_config $name
load_rc_config_var ipfilter ipfilter
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: network,v 1.46 2004/10/11 15:00:51 christos Exp $
# $NetBSD: network,v 1.47 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: network
@ -396,5 +396,7 @@ network_stop()
}
load_rc_config $name ipfilter
load_rc_config $name
load_rc_config_var dhclient dhclient
load_rc_config_var ipfilter ipfilter
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: nfsd,v 1.6 2004/10/11 14:11:43 lukem Exp $
# $NetBSD: nfsd,v 1.7 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: nfsd
@ -14,4 +14,6 @@ command="/usr/sbin/${name}"
required_vars="mountd rpcbind"
load_rc_config $name
load_rc_config_var rpcbind rpcbind
load_rc_config_var mountd mountd
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: nfslocking,v 1.7 2004/08/13 18:08:03 mycroft Exp $
# $NetBSD: nfslocking,v 1.8 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: nfslocking
@ -11,19 +11,27 @@ $_rc_subr_loaded . /etc/rc.subr
arg=$1
start_precmd='checkyesno nfs_server || checkyesno nfs_client ||
[ -n "$rc_force" ]'
stop_precmd=$start_precmd
status_precmd=$start_precmd
nfslocking_precmd()
{
checkyesno nfs_server || checkyesno nfs_client || [ -n "$rc_force" ]
}
name="statd"
rcvar=$name
command="/usr/sbin/rpc.${name}"
start_precmd='nfslocking_precmd'
stop_precmd=$start_precmd
status_precmd=$start_precmd
load_rc_config $name
load_rc_config_var nfsd nfs_server
run_rc_command "$arg"
name="lockd"
rcvar=$name
command="/usr/sbin/rpc.${name}"
start_precmd='nfslocking_precmd'
stop_precmd=$start_precmd
status_precmd=$start_precmd
load_rc_config $name
load_rc_config_var nfsd nfs_server
run_rc_command "$arg"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: routed,v 1.8 2004/08/13 18:08:03 mycroft Exp $
# $NetBSD: routed,v 1.9 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: routed
@ -23,4 +23,5 @@ routed_precmd()
}
load_rc_config $name
load_rc_config_var gated gated
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: smmsp,v 1.3 2004/08/13 18:08:03 mycroft Exp $
# $NetBSD: smmsp,v 1.4 2004/10/12 14:51:03 lukem Exp $
#
# REQUIRE: mail
@ -84,4 +84,5 @@ smmsp_precmd()
}
load_rc_config $name
load_rc_config_var sendmail sendmail_suidroot
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: yppasswdd,v 1.9 2004/10/11 15:00:51 christos Exp $
# $NetBSD: yppasswdd,v 1.10 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: yppasswdd
@ -25,4 +25,6 @@ yppasswdd_precmd()
}
load_rc_config $name
load_rc_config_var rpcbind rpcbind
load_rc_config_var ypserv ypserv
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: ypserv,v 1.7 2004/10/11 15:00:51 christos Exp $
# $NetBSD: ypserv,v 1.8 2004/10/12 14:51:03 lukem Exp $
#
# PROVIDE: ypserv
@ -29,4 +29,5 @@ ypserv_precmd()
}
load_rc_config $name
load_rc_config_var rpcbind rpcbind
run_rc_command "$1"