mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
use standard chronyd config file, but make sure it starts after docker as it is slow
Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
parent
24ad77edb7
commit
635a44ab99
@ -2,7 +2,6 @@ all: initrd.img
|
||||
|
||||
ETCFILES=etc/issue etc/motd etc/inittab etc/network/interfaces
|
||||
ETCFILES+=etc/hostname- etc/resolv.conf- etc/hosts-
|
||||
ETCFILES+=etc/init.d/chronyd
|
||||
ETCFILES+=etc/init.d/9pinit
|
||||
ETCFILES+=etc/init.d/automount
|
||||
ETCFILES+=etc/securetty
|
||||
|
@ -1,70 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2007 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/net-misc/chrony/files/chronyd.rc,v 1.8 2007/03/22 14:32:09 tove Exp $
|
||||
|
||||
description="NTP daemon"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall docker
|
||||
provide ntp-client ntp-server
|
||||
use dns
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
# Note that /etc/chrony/chrony.keys is *NOT* checked. This
|
||||
# is because the user may have specified another key
|
||||
# file, and we don't want to force the user to use that
|
||||
# exact name for the key file.
|
||||
if [ ! -f "${CFGFILE}" ] ; then
|
||||
eerror "Please create ${CFGFILE} and the"
|
||||
eerror "chrony key file (usually /etc/chrony/chrony.keys)"
|
||||
eerror "by using the"
|
||||
eerror ""
|
||||
eerror " chrony.conf.example"
|
||||
eerror " chrony.keys.example"
|
||||
eerror ""
|
||||
eerror "files (from the documentation directory)"
|
||||
eerror "as templates."
|
||||
return 1
|
||||
else
|
||||
# Actually, I tried it, and chrony seems to ignore the pidfile
|
||||
# option. I'm going to leave it here anyway, since you never
|
||||
# know if it might be handy
|
||||
PIDFILE=`awk '/^ *pidfile/{print $2}' "${CFGFILE}"`
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
setxtrarg() {
|
||||
if [ -c /dev/rtc ]; then
|
||||
grep -q '^rtcfile' "${CFGFILE}" && ARGS="${ARGS} -s"
|
||||
fi
|
||||
grep -q '^dumponexit$' "${CFGFILE}" && ARGS="${ARGS} -r"
|
||||
return 0
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return $?
|
||||
setxtrarg
|
||||
|
||||
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/chronyd.pid
|
||||
|
||||
ebegin "Starting chronyd"
|
||||
start-stop-daemon --start --quiet \
|
||||
--exec /usr/sbin/chronyd \
|
||||
--pidfile "${PIDFILE}" \
|
||||
-- -f "${CFGFILE}" ${ARGS} &
|
||||
}
|
||||
|
||||
stop() {
|
||||
checkconfig || return $?
|
||||
|
||||
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/chronyd.pid
|
||||
|
||||
ebegin "Stopping chronyd"
|
||||
start-stop-daemon --stop --quiet \
|
||||
--pidfile "${PIDFILE}"
|
||||
eend $? "Failed to stop chronyd"
|
||||
}
|
@ -6,3 +6,9 @@ command_args="daemon -p \"${pidfile}\" ${DOCKER_OPTS}"
|
||||
DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
|
||||
start_stop_daemon_args="--background \
|
||||
--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
|
||||
|
||||
depend()
|
||||
{
|
||||
after 9pudc
|
||||
before chronyd
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user