*chronyd* was compiled with debugging support, this option can be used twice to
print also debugging messages.
+*-l* _file_::
+This option specifies a file which should be used for logging instead of syslog
+or terminal.
+
*-q*::
When run in this mode, *chronyd* will set the system clock once and exit. It
will not detach from the terminal.
{
const char *conf_file = DEFAULT_CONF_FILE;
const char *progname = argv[0];
- char *user = NULL;
+ char *user = NULL, *log_file = NULL;
struct passwd *pw;
int debug = 0, nofork = 0, address_family = IPADDR_UNSPEC;
int do_init_rtc = 0, restarted = 0, timeout = 0;
/* This write to the terminal is OK, it comes before we turn into a daemon */
printf("chronyd (chrony) version %s (%s)\n", CHRONY_VERSION, CHRONYD_FEATURES);
return 0;
+ } else if (!strcmp("-l", *argv)) {
+ ++argv, --argc;
+ log_file = *argv;
} else if (!strcmp("-n", *argv)) {
nofork = 1;
} else if (!strcmp("-d", *argv)) {
go_daemon();
}
- if (system_log) {
+ if (log_file) {
+ LOG_OpenFileLog(log_file);
+ } else if (system_log) {
LOG_OpenSystemLog();
}