summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2015-12-19 14:10:42 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2015-12-19 14:10:42 +0000
commit73f1b800bdbe09c87cc5bbc195ad51cce3603f34 (patch)
tree858e0eab11f537d5b8aadbe63158dad421967d22
parent78768a699ca477af5265f9be9ea8188eb54fbbf7 (diff)
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
-rw-r--r--etc/rc.d/rc.subr9
1 files changed, 2 insertions, 7 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index b25f75c62a8..e205fd6cc25 100644
--- a/etc/rc.d/rc.subr
+++ b/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 <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -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