summaryrefslogtreecommitdiff
path: root/etc/rc.d/rc.subr
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-03-06 16:49:49 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-03-06 16:49:49 +0000
commit6b182f2815fe18c634c9c1de0f3f5a67c166e4d0 (patch)
treef87bb7ecb2b1d7b8828c4b9bd589233d996e386c /etc/rc.d/rc.subr
parent8fcee31b845ae0f4dd57521addb372071b1bced3 (diff)
Add an "rc_bg" variable that is undefined by default and allows to start
a daemon in the background. man page tweaks from schwarze@ discussed with an ok schwarze@ robert@
Diffstat (limited to 'etc/rc.d/rc.subr')
-rw-r--r--etc/rc.d/rc.subr6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index 5032dfbc869..b236373e489 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.20 2011/02/24 07:07:03 ajacoutot Exp $
+# $OpenBSD: rc.subr,v 1.21 2011/03/06 16:49:48 ajacoutot Exp $
rc_err() {
echo $1
@@ -7,7 +7,7 @@ rc_err() {
rc_start() {
type rc_pre >/dev/null && rc_pre
- ${rcexec} "${daemon} ${daemon_flags}" >/dev/null
+ ${rcexec} "${daemon} ${daemon_flags} >/dev/null ${_bg}"
}
rc_check() {
@@ -30,6 +30,8 @@ rc_cmd() {
eval _enotsup=\${rc_${1}}
[ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported"
+ [ X"${rc_bg}" = X"YES" ] && local _bg="&"
+
case "$1" in
check)
rc_check