summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2017-05-27 19:55:49 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2017-05-27 19:55:49 +0000
commitc144bf32706dda417076da6257524a52385efda9 (patch)
tree46341e2a0d2777a32b2a6e63453a349bcc240e70 /etc
parentfe30c058ab83dfb07358dfaf9d492788897a6b0c (diff)
Ok turns out we still want to keep the rc_bg variable around but we need
to know which daemon cannot background themselves (actually we want to know the opposite, but there are much more). However, it's only needed in _rc_wait and rc.subr still does its magic without the need to add `&'.
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/rc.subr5
-rw-r--r--etc/rc.d/ypbind3
2 files changed, 5 insertions, 3 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index 3579c7d594d..71caf579de8 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.119 2017/05/27 13:51:52 ajacoutot Exp $
+# $OpenBSD: rc.subr,v 1.120 2017/05/27 19:55:48 ajacoutot Exp $
#
# Copyright (c) 2010, 2011, 2014-2017 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -91,7 +91,8 @@ _rc_wait() {
if [ X"$1" = X"start" ]; then # prevent hanging the boot sequence
trap "_rc_alarm" ALRM
while [ $_i -lt ${daemon_timeout} ]; do
- _rc_do rc_check && break
+ _rc_do rc_check && [ X"${rc_bg}" = X"YES" ] && break ||
+ [ -z "$$" ] && break
sleep 1
_i=$((_i+1))
done & wait
diff --git a/etc/rc.d/ypbind b/etc/rc.d/ypbind
index 7c20bda3412..f18aad8e618 100644
--- a/etc/rc.d/ypbind
+++ b/etc/rc.d/ypbind
@@ -1,11 +1,12 @@
#!/bin/sh
#
-# $OpenBSD: ypbind,v 1.6 2017/05/27 13:51:52 ajacoutot Exp $
+# $OpenBSD: ypbind,v 1.7 2017/05/27 19:55:48 ajacoutot Exp $
daemon="/usr/sbin/ypbind"
. /etc/rc.d/rc.subr
+rc_bg=YES
rc_reload=NO
rc_pre() {