aboutsummaryrefslogtreecommitdiffstats
path: root/main/chrony/chronyd.initd
diff options
context:
space:
mode:
authortcely <tcely@users.noreply.github.com>2018-11-19 20:15:12 -0500
committerSören Tempel <soeren+git@soeren-tempel.net>2019-04-17 10:59:31 +0200
commitb2ec731f63217ecd1b39adee162bade358d1ffdc (patch)
treeeb246197c42a165707b944703167006e783630fd /main/chrony/chronyd.initd
parent65662ceedf9c895da8e96d9cdba7a68f9cfe8740 (diff)
main/chrony: set default PID file path
Diffstat (limited to 'main/chrony/chronyd.initd')
-rw-r--r--main/chrony/chronyd.initd10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/chrony/chronyd.initd b/main/chrony/chronyd.initd
index 569026f5153..cc99e5cdf9f 100644
--- a/main/chrony/chronyd.initd
+++ b/main/chrony/chronyd.initd
@@ -4,6 +4,7 @@
# $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"
+PIDFILE="/var/run/chrony/chronyd.pid"
depend() {
need net
@@ -32,7 +33,10 @@ checkconfig() {
# 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}"`
+ _cfg_PIDFILE=`awk '/^ *pidfile/{print $2}' "${CFGFILE}"`
+ if [ -n "$_cfg_PIDFILE" ] ; then
+ PIDFILE="$_cfg_PIDFILE"
+ fi
fi
return 0
}
@@ -49,8 +53,6 @@ start() {
checkconfig || return $?
setxtrarg
- [ -n "${PIDFILE}" ] || PIDFILE=/var/run/chrony/chronyd.pid
-
local daemon_args=
if yesno "$FAST_STARTUP"; then
ARGS="${ARGS} -n"
@@ -68,8 +70,6 @@ start() {
stop() {
checkconfig || return $?
- [ -n "${PIDFILE}" ] || PIDFILE=/var/run/chrony/chronyd.pid
-
ebegin "Stopping chronyd"
start-stop-daemon --stop --quiet \
--pidfile "${PIDFILE}"