From 7fe3ad835355c3fde861bcb6c34f7b1d49abfc0a Mon Sep 17 00:00:00 2001 From: ajacoutot <> Date: Mon, 5 Jun 2017 15:24:57 +0000 Subject: [PATCH] Fix logic in _rc_wait to properly cope with setproctitle(3) daemons. It was a regression from my recent rc.subr changes. reported by deraadt@ and naddy@ : pflogd was marked as failed during boot while it was properly running --- src/etc/rc.d/rc.subr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index e87f0b4b..b0317d13 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.125 2017/05/30 12:04:26 tb Exp $ +# $OpenBSD: rc.subr,v 1.126 2017/06/05 15:24:57 ajacoutot Exp $ # # Copyright (c) 2010, 2011, 2014-2017 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -91,8 +91,9 @@ _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 && [ X"${rc_bg}" = X"YES" ] && break || - [ -z "$$" ] && break + if _rc_do rc_check; then + [ X"${rc_bg}" = X"YES" ] || [ -z "$$" ] && break + fi sleep 1 _i=$((_i+1)) done & wait