From: Miroslav Lichvar Date: Thu, 7 Jun 2018 14:43:59 +0000 (+0200) Subject: main: create directories before writing pidfile X-Git-Tag: 3.4-pre1~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26e08abe71fe66703e06afae1168144dd1eecf3f;p=thirdparty%2Fchrony.git main: create directories before writing pidfile This makes it possible to save pidfile in /var/run/chrony. --- diff --git a/main.c b/main.c index a2202e99..e538cc5b 100644 --- a/main.c +++ b/main.c @@ -530,9 +530,6 @@ int main /* Check whether another chronyd may already be running */ check_pidfile(); - /* Write our pidfile to prevent other chronyds running */ - write_pidfile(); - if (!user) user = CNF_GetUser(); @@ -543,6 +540,9 @@ int main /* Create directories for sockets, log files, and dump files */ CNF_CreateDirs(pw->pw_uid, pw->pw_gid); + /* Write our pidfile to prevent other instances from running */ + write_pidfile(); + PRV_Initialise(); LCL_Initialise(); SCH_Initialise();