mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 06:15:07 -05:00
main: create directories before writing pidfile
This makes it possible to save pidfile in /var/run/chrony.
This commit is contained in:
6
main.c
6
main.c
@@ -530,9 +530,6 @@ int main
|
|||||||
/* Check whether another chronyd may already be running */
|
/* Check whether another chronyd may already be running */
|
||||||
check_pidfile();
|
check_pidfile();
|
||||||
|
|
||||||
/* Write our pidfile to prevent other chronyds running */
|
|
||||||
write_pidfile();
|
|
||||||
|
|
||||||
if (!user)
|
if (!user)
|
||||||
user = CNF_GetUser();
|
user = CNF_GetUser();
|
||||||
|
|
||||||
@@ -543,6 +540,9 @@ int main
|
|||||||
/* Create directories for sockets, log files, and dump files */
|
/* Create directories for sockets, log files, and dump files */
|
||||||
CNF_CreateDirs(pw->pw_uid, pw->pw_gid);
|
CNF_CreateDirs(pw->pw_uid, pw->pw_gid);
|
||||||
|
|
||||||
|
/* Write our pidfile to prevent other instances from running */
|
||||||
|
write_pidfile();
|
||||||
|
|
||||||
PRV_Initialise();
|
PRV_Initialise();
|
||||||
LCL_Initialise();
|
LCL_Initialise();
|
||||||
SCH_Initialise();
|
SCH_Initialise();
|
||||||
|
|||||||
Reference in New Issue
Block a user