|
|
dabfaa |
commit 26e08abe71fe66703e06afae1168144dd1eecf3f
|
|
|
dabfaa |
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
|
dabfaa |
Date: Thu Jun 7 16:43:59 2018 +0200
|
|
|
dabfaa |
|
|
|
dabfaa |
main: create directories before writing pidfile
|
|
|
dabfaa |
|
|
|
dabfaa |
This makes it possible to save pidfile in /var/run/chrony.
|
|
|
dabfaa |
|
|
|
dabfaa |
diff --git a/main.c b/main.c
|
|
|
dabfaa |
index a2202e9..e538cc5 100644
|
|
|
dabfaa |
--- a/main.c
|
|
|
dabfaa |
+++ b/main.c
|
|
|
dabfaa |
@@ -530,9 +530,6 @@ int main
|
|
|
dabfaa |
/* Check whether another chronyd may already be running */
|
|
|
dabfaa |
check_pidfile();
|
|
|
dabfaa |
|
|
|
dabfaa |
- /* Write our pidfile to prevent other chronyds running */
|
|
|
dabfaa |
- write_pidfile();
|
|
|
dabfaa |
-
|
|
|
dabfaa |
if (!user)
|
|
|
dabfaa |
user = CNF_GetUser();
|
|
|
dabfaa |
|
|
|
dabfaa |
@@ -543,6 +540,9 @@ int main
|
|
|
dabfaa |
/* Create directories for sockets, log files, and dump files */
|
|
|
dabfaa |
CNF_CreateDirs(pw->pw_uid, pw->pw_gid);
|
|
|
dabfaa |
|
|
|
dabfaa |
+ /* Write our pidfile to prevent other instances from running */
|
|
|
dabfaa |
+ write_pidfile();
|
|
|
dabfaa |
+
|
|
|
dabfaa |
PRV_Initialise();
|
|
|
dabfaa |
LCL_Initialise();
|
|
|
dabfaa |
SCH_Initialise();
|
|
|
dabfaa |
|
|
|
dabfaa |
commit e50dc739d88feca6e0da034406034f3d3cf60ca4
|
|
|
dabfaa |
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
|
dabfaa |
Date: Thu Jun 7 16:54:59 2018 +0200
|
|
|
dabfaa |
|
|
|
dabfaa |
configure: move default pidfile to /var/run/chrony
|
|
|
dabfaa |
|
|
|
dabfaa |
This allows chronyd to remove its pidfile on exit after dropping the
|
|
|
dabfaa |
root privileges in order to prevent another chronyd instance from
|
|
|
dabfaa |
failing to start, e.g. due to a wrong SELinux label from chronyd -q.
|
|
|
dabfaa |
|
|
|
dabfaa |
diff --git a/configure b/configure
|
|
|
dabfaa |
index 25773de..c5de5ea 100755
|
|
|
dabfaa |
--- a/configure
|
|
|
dabfaa |
+++ b/configure
|
|
|
dabfaa |
@@ -108,7 +108,7 @@ For better control, use the options below.
|
|
|
dabfaa |
since 1970-01-01 [50*365 days ago]
|
|
|
dabfaa |
--with-user=USER Specify default chronyd user [root]
|
|
|
dabfaa |
--with-hwclockfile=PATH Specify default path to hwclock(8) adjtime file
|
|
|
dabfaa |
- --with-pidfile=PATH Specify default pidfile [/var/run/chronyd.pid]
|
|
|
dabfaa |
+ --with-pidfile=PATH Specify default pidfile [/var/run/chrony/chronyd.pid]
|
|
|
dabfaa |
--with-rtcdevice=PATH Specify default path to RTC device [/dev/rtc]
|
|
|
dabfaa |
--with-sendmail=PATH Path to sendmail binary [/usr/lib/sendmail]
|
|
|
dabfaa |
--enable-debug Enable debugging support
|
|
|
dabfaa |
@@ -229,7 +229,7 @@ feat_ntp_signd=0
|
|
|
dabfaa |
ntp_era_split=""
|
|
|
dabfaa |
default_user="root"
|
|
|
dabfaa |
default_hwclockfile=""
|
|
|
dabfaa |
-default_pidfile="/var/run/chronyd.pid"
|
|
|
dabfaa |
+default_pidfile="/var/run/chrony/chronyd.pid"
|
|
|
dabfaa |
default_rtcdevice="/dev/rtc"
|
|
|
dabfaa |
mail_program="/usr/lib/sendmail"
|
|
|
dabfaa |
|
|
|
dabfaa |
|
|
|
dabfaa |
commit 10150bfcab76141b3a9c33b95ad71904fe8ecca2
|
|
|
dabfaa |
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
|
dabfaa |
Date: Thu Jun 7 17:43:57 2018 +0200
|
|
|
dabfaa |
|
|
|
dabfaa |
examples: update pidfile in chronyd.service
|
|
|
dabfaa |
|
|
|
dabfaa |
diff --git a/examples/chronyd.service b/examples/chronyd.service
|
|
|
dabfaa |
index 4ffe3b1..1777413 100644
|
|
|
dabfaa |
--- a/examples/chronyd.service
|
|
|
dabfaa |
+++ b/examples/chronyd.service
|
|
|
dabfaa |
@@ -7,7 +7,7 @@ ConditionCapability=CAP_SYS_TIME
|
|
|
dabfaa |
|
|
|
dabfaa |
[Service]
|
|
|
dabfaa |
Type=forking
|
|
|
dabfaa |
-PIDFile=/var/run/chronyd.pid
|
|
|
dabfaa |
+PIDFile=/var/run/chrony/chronyd.pid
|
|
|
dabfaa |
EnvironmentFile=-/etc/sysconfig/chronyd
|
|
|
dabfaa |
ExecStart=/usr/sbin/chronyd $OPTIONS
|
|
|
dabfaa |
PrivateTmp=yes
|