|
|
@ -1,16 +1,16 @@ |
|
|
|
From 5c0b2ba4ef077a253a8ce0a11fb536b7f696ddbf Mon Sep 17 00:00:00 2001 |
|
|
|
From d7d30f3467758025c4aba9e0ff45bd3178d6ff15 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 |
|
|
|
Subject: [PATCH 07/12] add -p option to create a pid file |
|
|
|
|
|
|
|
This is used in both the Gentoo and Debian ports. |
|
|
|
|
|
|
|
Origin: https://bugs.gentoo.org/show_bug.cgi?id=493082 |
|
|
|
---
|
|
|
|
src/usr.sbin/ntpd/ntpd.8 | 4 ++++ |
|
|
|
src/usr.sbin/ntpd/ntpd.c | 35 +++++++++++++++++++++++++++++------ |
|
|
|
src/usr.sbin/ntpd/ntpd.c | 33 ++++++++++++++++++++++++++++----- |
|
|
|
src/usr.sbin/ntpd/ntpd.h | 1 + |
|
|
|
3 files changed, 34 insertions(+), 6 deletions(-) |
|
|
|
3 files changed, 33 insertions(+), 5 deletions(-) |
|
|
|
|
|
|
|
diff --git a/src/usr.sbin/ntpd/ntpd.8 b/src/usr.sbin/ntpd/ntpd.8
|
|
|
|
index dcfb6d2..1b885a1 100644
|
|
|
@ -35,7 +35,7 @@ index dcfb6d2..1b885a1 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 43486f0..f8727f6 100644
|
|
|
|
index 43486f0..2377d89 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/ntpd.c
|
|
|
|
+++ b/src/usr.sbin/ntpd/ntpd.c
|
|
|
|
@@ -87,6 +87,18 @@ sighdlr(int sig)
|
|
|
@ -93,20 +93,11 @@ index 43486f0..f8727f6 100644 |
|
|
|
+ if (!lconf.debug) {
|
|
|
|
if (daemon(1, 0)) |
|
|
|
fatal("daemon"); |
|
|
|
+ writepid(&lconf);
|
|
|
|
+ }
|
|
|
|
+ writepid(&lconf);
|
|
|
|
} else |
|
|
|
timeout = SETTIME_TIMEOUT * 1000; |
|
|
|
|
|
|
|
@@ -230,7 +247,7 @@ main(int argc, char *argv[])
|
|
|
|
* Constraint processes are forked with certificates in memory, |
|
|
|
* then privdrop into chroot before speaking to the outside world. |
|
|
|
*/ |
|
|
|
-#if 0
|
|
|
|
+#if 0
|
|
|
|
if (pledge("stdio rpath inet settime proc id", NULL) == -1) |
|
|
|
err(1, "pledge"); |
|
|
|
#endif |
|
|
|
@@ -275,9 +292,11 @@ main(int argc, char *argv[])
|
|
|
|
log_verbose(lconf.verbose); |
|
|
|
log_warnx("no reply received in time, skipping initial " |
|
|
@ -143,10 +134,10 @@ index 43486f0..f8727f6 100644 |
|
|
|
timeout = INFTIM; |
|
|
|
break; |
|
|
|
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
|
|
|
|
index 9ee2e42..d39628c 100644
|
|
|
|
index 375edc1..e40bf5e 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/ntpd.h
|
|
|
|
+++ b/src/usr.sbin/ntpd/ntpd.h
|
|
|
|
@@ -237,6 +237,7 @@ struct ntpd_conf {
|
|
|
|
@@ -243,6 +243,7 @@ struct ntpd_conf {
|
|
|
|
u_int constraint_errors; |
|
|
|
u_int8_t *ca; |
|
|
|
size_t ca_len; |
|
|
@ -155,5 +146,5 @@ index 9ee2e42..d39628c 100644 |
|
|
|
|
|
|
|
struct ctl_show_status { |
|
|
|
--
|
|
|
|
2.8.1 |
|
|
|
2.9.2 |
|
|
|
|