|
|
@ -1,4 +1,4 @@ |
|
|
|
From ecb9f8a24e3d906ecf26ff2eef52a15e62c98e25 Mon Sep 17 00:00:00 2001 |
|
|
|
From a9008bf22c4f706cf2a4ce12dac9eb282f295933 Mon Sep 17 00:00:00 2001 |
|
|
|
From: Brent Cook <busterb@gmail.com> |
|
|
|
Date: Wed, 31 Dec 2014 08:26:41 -0600 |
|
|
|
Subject: [PATCH 07/13] add -p option to create a pid file |
|
|
@ -13,7 +13,7 @@ Origin: https://bugs.gentoo.org/show_bug.cgi?id=493082 |
|
|
|
3 files changed, 33 insertions(+), 5 deletions(-) |
|
|
|
|
|
|
|
diff --git a/src/usr.sbin/ntpd/ntpd.8 b/src/usr.sbin/ntpd/ntpd.8
|
|
|
|
index 689d269c6c..fbcfa85b3f 100644
|
|
|
|
index 0b74c2587f..63b027403c 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/ntpd.8
|
|
|
|
+++ b/src/usr.sbin/ntpd/ntpd.8
|
|
|
|
@@ -25,6 +25,7 @@
|
|
|
@ -35,10 +35,10 @@ index 689d269c6c..fbcfa85b3f 100644 |
|
|
|
Do not set the time immediately at startup. |
|
|
|
This is the default. |
|
|
|
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
|
|
|
|
index 0ec3ede03b..3d9e089b3e 100644
|
|
|
|
index 44c4f72f3f..7c8eda5a1d 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/ntpd.c
|
|
|
|
+++ b/src/usr.sbin/ntpd/ntpd.c
|
|
|
|
@@ -87,6 +87,18 @@ sighdlr(int sig)
|
|
|
|
@@ -88,6 +88,18 @@ sighdlr(int sig)
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -57,7 +57,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
__dead void |
|
|
|
usage(void) |
|
|
|
{ |
|
|
|
@@ -96,7 +108,7 @@ usage(void)
|
|
|
|
@@ -97,7 +109,7 @@ usage(void)
|
|
|
|
fprintf(stderr, |
|
|
|
"usage: ntpctl -s all | peers | Sensors | status\n"); |
|
|
|
else |
|
|
@ -66,7 +66,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
__progname); |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
@@ -132,7 +144,7 @@ main(int argc, char *argv[])
|
|
|
|
@@ -133,7 +145,7 @@ main(int argc, char *argv[])
|
|
|
|
|
|
|
|
memset(&lconf, 0, sizeof(lconf)); |
|
|
|
|
|
|
@ -75,7 +75,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
switch (ch) { |
|
|
|
case 'd': |
|
|
|
lconf.debug = 2; |
|
|
|
@@ -147,6 +159,9 @@ main(int argc, char *argv[])
|
|
|
|
@@ -148,6 +160,9 @@ main(int argc, char *argv[])
|
|
|
|
case 'P': |
|
|
|
pname = optarg; |
|
|
|
break; |
|
|
@ -85,7 +85,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
case 's': |
|
|
|
lconf.settime = 1; |
|
|
|
break; |
|
|
|
@@ -210,9 +225,11 @@ main(int argc, char *argv[])
|
|
|
|
@@ -214,9 +229,11 @@ main(int argc, char *argv[])
|
|
|
|
if (!lconf.settime) { |
|
|
|
log_init(lconf.debug, LOG_DAEMON); |
|
|
|
log_setverbose(lconf.verbose); |
|
|
@ -98,7 +98,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
} else |
|
|
|
timeout = SETTIME_TIMEOUT * 1000; |
|
|
|
|
|
|
|
@@ -287,9 +304,11 @@ main(int argc, char *argv[])
|
|
|
|
@@ -298,9 +315,11 @@ main(int argc, char *argv[])
|
|
|
|
log_setverbose(lconf.verbose); |
|
|
|
log_warnx("no reply received in time, skipping initial " |
|
|
|
"time setting"); |
|
|
@ -111,7 +111,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
} |
|
|
|
|
|
|
|
if (nfds > 0 && (pfd[PFD_PIPE].revents & POLLOUT)) |
|
|
|
@@ -328,6 +347,8 @@ main(int argc, char *argv[])
|
|
|
|
@@ -339,6 +358,8 @@ main(int argc, char *argv[])
|
|
|
|
msgbuf_clear(&ibuf->w); |
|
|
|
free(ibuf); |
|
|
|
log_info("Terminating"); |
|
|
@ -120,7 +120,7 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
return (0); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -388,9 +409,11 @@ dispatch_imsg(struct ntpd_conf *lconf, int argc, char **argv)
|
|
|
|
@@ -399,9 +420,11 @@ dispatch_imsg(struct ntpd_conf *lconf, int argc, char **argv)
|
|
|
|
memcpy(&d, imsg.data, sizeof(d)); |
|
|
|
ntpd_settime(d); |
|
|
|
/* daemonize now */ |
|
|
@ -134,10 +134,10 @@ index 0ec3ede03b..3d9e089b3e 100644 |
|
|
|
timeout = INFTIM; |
|
|
|
break; |
|
|
|
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
|
|
|
|
index b7ddfee0ae..39b8e7bf43 100644
|
|
|
|
index 0f7313c78e..7ee919dd09 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/ntpd.h
|
|
|
|
+++ b/src/usr.sbin/ntpd/ntpd.h
|
|
|
|
@@ -253,6 +253,7 @@ struct ntpd_conf {
|
|
|
|
@@ -250,6 +250,7 @@ struct ntpd_conf {
|
|
|
|
u_int constraint_errors; |
|
|
|
u_int8_t *ca; |
|
|
|
size_t ca_len; |
|
|
@ -146,5 +146,5 @@ index b7ddfee0ae..39b8e7bf43 100644 |
|
|
|
|
|
|
|
struct ctl_show_status { |
|
|
|
--
|
|
|
|
2.14.0 |
|
|
|
2.20.1 |
|
|
|
|