mirror of
https://gitlab.com/chrony/chrony.git
synced 2026-01-20 21:00:20 -05:00
main: don't require root privileges with -Q option
If the -Q option is specified, disable by default pidfile, ntpport, cmdport, Unix domain command socket, and clock control, in order to allow starting chronyd without root privileges and/or when another chronyd instance is already running.
This commit is contained in:
13
conf.c
13
conf.c
@@ -323,7 +323,7 @@ check_number_of_args(char *line, int num)
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
CNF_Initialise(int r)
|
||||
CNF_Initialise(int r, int client_only)
|
||||
{
|
||||
restarted = r;
|
||||
|
||||
@@ -339,11 +339,18 @@ CNF_Initialise(int r)
|
||||
|
||||
dumpdir = Strdup("");
|
||||
logdir = Strdup("");
|
||||
bind_cmd_path = Strdup(DEFAULT_COMMAND_SOCKET);
|
||||
pidfile = Strdup(DEFAULT_PID_FILE);
|
||||
rtc_device = Strdup(DEFAULT_RTC_DEVICE);
|
||||
hwclock_file = Strdup(DEFAULT_HWCLOCK_FILE);
|
||||
user = Strdup(DEFAULT_USER);
|
||||
|
||||
if (client_only) {
|
||||
cmd_port = ntp_port = 0;
|
||||
bind_cmd_path = Strdup("");
|
||||
pidfile = Strdup("");
|
||||
} else {
|
||||
bind_cmd_path = Strdup(DEFAULT_COMMAND_SOCKET);
|
||||
pidfile = Strdup(DEFAULT_PID_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user