Browse Source

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
OPENBSD_5_9
ajacoutot 8 years ago
parent
commit
643ff62e07
1 changed files with 2 additions and 7 deletions
  1. +2
    -7
      src/etc/rc.d/rc.subr

+ 2
- 7
src/etc/rc.d/rc.subr View File

@ -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


Loading…
Cancel
Save