The only version where this happens so far is Linux. On systems where
this is not the case, e.g. Solaris and SunOS the option should not be
used.
+@item -R
+When this option is used, the @code{initstepslew} directive and the
+@code{makestep} directive used with a positive limit will be ignored.
+This option is useful when restarting @code{chronyd} and can be used
+in conjuction with the `-r' option.
+
@item -s
This option will set the system clock from the computer's real-time
clock. This is analogous to supplying the `-s' flag to the
On systems where this is not the case, e.g. Solaris and SunOS the option
should not be used.
.TP
+.B \-R
+When this option is used, the \fIinitstepslew\fR directive and the
+\fImakestep\fR directive used with a positive limit will be ignored. This
+option is useful when restarting \fBchronyd\fR and can be used in conjuction
+with the \fB-r\fR option.
+.TP
.B \-s
This option will set the system clock from the computer's real-time
clock. This is analogous to supplying the \fI-s\fR flag to the
/* ================================================== */
/* Configuration variables */
+static int restarted = 0;
static char *rtc_device = "/dev/rtc";
static int acquisition_port = 0; /* 0 means let kernel choose port */
static int ntp_port = 123;
/* ================================================== */
+void
+CNF_SetRestarted(int r)
+{
+ restarted = r;
+}
+
+/* ================================================== */
+
/* Read the configuration file */
void
CNF_ReadFile(const char *filename)
int threshold;
IPAddr ip_addr;
+ /* Ignore the line if chronyd was started with -R. */
+ if (restarted) {
+ return;
+ }
+
n_init_srcs = 0;
p = line;
"Could not read threshold or update limit for stepping clock at line %d\n",
line_number);
}
+
+ /* Disable limited makestep if chronyd was started with -R. */
+ if (restarted && make_step_limit > 0) {
+ make_step_limit = 0;
+ }
}
/* ================================================== */
#include "addressing.h"
+extern void CNF_SetRestarted(int);
+
extern char *CNF_GetRtcDevice(void);
extern void CNF_ReadFile(const char *filename);
char *conf_file = NULL;
char *user = NULL;
int debug = 0, nofork = 0;
- int do_init_rtc = 0;
+ int do_init_rtc = 0, restarted = 0;
int other_pid;
int lock_memory = 0, sched_priority = 0;
lock_memory = 1;
} else if (!strcmp("-r", *argv)) {
reload = 1;
+ } else if (!strcmp("-R", *argv)) {
+ restarted = 1;
} else if (!strcmp("-u", *argv)) {
++argv, --argc;
if (argc == 0) {
LOG(LOGS_INFO, LOGF_Main, "chronyd version %s starting", CHRONY_VERSION);
+ CNF_SetRestarted(restarted);
CNF_ReadFile(conf_file);
/* Check whether another chronyd may already be running. Do this after