From 643ff62e073ac845be3ac1c258ca9092a88f2cee Mon Sep 17 00:00:00 2001 From: ajacoutot <> Date: Sat, 19 Dec 2015 14:10:41 +0000 Subject: [PATCH] After starting, unconditionally wait up to $daemon_timeout seconds to check that the daemon is actually running (instead of only when using rc_bg). This *may* trigger the following side effect: if a daemon starts then stops right away (because of a config parsing issue for e.g.), then it will slow down the boot process because rc will wait a bit before considering the start action failed. But at least it will allow us to detect those daemons and fix them or their rc.d(8) script. At least as far as I can tell, all base daemons should cope with it just fine. ok sthen@ robert@ on an earlier diff --- src/etc/rc.d/rc.subr | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index b25f75c6..e205fd6c 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.102 2015/12/19 11:19:17 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.103 2015/12/19 14:10:41 ajacoutot Exp $ # # Copyright (c) 2010, 2011, 2014 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -202,13 +202,8 @@ rc_cmd() { if type rc_pre >/dev/null; then _rc_do rc_pre || break fi - # XXX only checks the status of the return code, - # and _not_ that the daemon is actually running _rc_do rc_start || break - if [ -n "${_bg}" ]; then - sleep 1 - _rc_do _rc_wait start || break - fi + _rc_do _rc_wait start || break _rc_do _rc_write_runfile _rc_exit ok done