aboutsummaryrefslogtreecommitdiffstats
path: root/main/chrony/chronyd.initd
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2018-10-12 12:28:19 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2018-10-15 09:37:33 +0200
commitf404cbdcff61180ebefab499c532e29a93ef745e (patch)
tree77ef6bbb7cd773b66823737a668de7faf15f49f2 /main/chrony/chronyd.initd
parenta6a5eb50ee4d4411531f618e286f5e2fd6f8e410 (diff)
downloadaports-f404cbdcff61180ebefab499c532e29a93ef745e.tar.bz2
aports-f404cbdcff61180ebefab499c532e29a93ef745e.tar.xz
main/chrony: add FAST_STARTUP option to OpenRC services
chronyd takes quite some time to perform a double fork to deamonize, thereby blocking OpenRC. This is probably the case because it blocks until time is synchronized. When enabled the FAST_STARTUP option performs the double fork through start-stop-daemon(1) thereby significantly reducing the startup of the chronyd service.
Diffstat (limited to 'main/chrony/chronyd.initd')
-rw-r--r--main/chrony/chronyd.initd8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/chrony/chronyd.initd b/main/chrony/chronyd.initd
index 771bb5b534..51c1afad4a 100644
--- a/main/chrony/chronyd.initd
+++ b/main/chrony/chronyd.initd
@@ -51,8 +51,14 @@ start() {
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/chronyd.pid
+ local daemon_args=
+ if yesno "$FAST_STARTUP"; then
+ ARGS="${ARGS} -n"
+ daemon_args="--background"
+ fi
+
ebegin "Starting chronyd"
- start-stop-daemon --start --quiet \
+ start-stop-daemon $daemon_args --start --quiet \
--exec /usr/sbin/chronyd \
--pidfile "${PIDFILE}" \
-- -f "${CFGFILE}" ${ARGS}