diff options
author | Jeroen Roovers <jer@gentoo.org> | 2015-12-04 07:04:30 +0100 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2015-12-04 07:04:30 +0100 |
commit | 65b7de580ed1bd180ab46e1a600a394bca25248b (patch) | |
tree | 0865f7b3a3b82cc9d14dcadf15eb9bf45bae6502 /net-misc/chrony/files | |
parent | sys-apps/busybox: Stable for PPC64 (bug #564246). (diff) | |
download | gentoo-65b7de580ed1bd180ab46e1a600a394bca25248b.tar.gz gentoo-65b7de580ed1bd180ab46e1a600a394bca25248b.tar.bz2 gentoo-65b7de580ed1bd180ab46e1a600a394bca25248b.zip |
net-misc/chrony: Drop s-s-d --background from init.d script (bug #566972 by Peter Humphrey and Holger Hoffstätte).
Package-Manager: portage-2.2.26
Diffstat (limited to 'net-misc/chrony/files')
-rw-r--r-- | net-misc/chrony/files/chronyd.init-r1 | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/net-misc/chrony/files/chronyd.init-r1 b/net-misc/chrony/files/chronyd.init-r1 new file mode 100644 index 000000000000..80ec85518957 --- /dev/null +++ b/net-misc/chrony/files/chronyd.init-r1 @@ -0,0 +1,70 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + 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=/run/chronyd.pid + + ebegin "Starting chronyd" + start-stop-daemon \ + --start \ + --quiet \ + --exec /usr/sbin/chronyd \ + --pidfile "${PIDFILE}" \ + -- -f "${CFGFILE}" ${ARGS} + eend $? "Failed to start chronyd" +} + +stop() { + checkconfig || return $? + + [ -n "${PIDFILE}" ] || PIDFILE=/run/chronyd.pid + + ebegin "Stopping chronyd" + start-stop-daemon \ + --stop \ + --quiet \ + --pidfile "${PIDFILE}" + eend $? "Failed to stop chronyd" +} |