From 6f1669a9a10fd0fad0319e19c961683a72d45284 Mon Sep 17 00:00:00 2001 From: ajacoutot <> Date: Sat, 27 May 2017 19:55:48 +0000 Subject: [PATCH] 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 `&'. --- src/etc/rc.d/rc.subr | 5 +++-- src/etc/rc.d/ypbind | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index 3579c7d5..71caf579 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/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 # Copyright (c) 2010, 2011 Ingo Schwarze @@ -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/src/etc/rc.d/ypbind b/src/etc/rc.d/ypbind index 7c20bda3..f18aad8e 100644 --- a/src/etc/rc.d/ypbind +++ b/src/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() {