summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-misc/openntpd/files/openntpd-20080406-pidfile.patch
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-misc/openntpd/files/openntpd-20080406-pidfile.patch')
-rw-r--r--net-misc/openntpd/files/openntpd-20080406-pidfile.patch141
1 files changed, 141 insertions, 0 deletions
diff --git a/net-misc/openntpd/files/openntpd-20080406-pidfile.patch b/net-misc/openntpd/files/openntpd-20080406-pidfile.patch
new file mode 100644
index 000000000000..d2ee38504c3e
--- /dev/null
+++ b/net-misc/openntpd/files/openntpd-20080406-pidfile.patch
@@ -0,0 +1,141 @@
+adding a -p option to openntpd to create a pidfile
+
+https://bugs.gentoo.org/show_bug.cgi?id=493082
+
+diff -u -r openntpd-20080406p.orig/ntpd.8 openntpd-20080406p/ntpd.8
+--- openntpd-20080406p.orig/ntpd.8 2013-12-01 12:49:49.773116316 -0800
++++ openntpd-20080406p/ntpd.8 2013-12-01 13:27:39.417324497 -0800
+@@ -25,6 +25,7 @@
+ .Bk -words
+ .Op Fl dnSsv
+ .Op Fl f Ar file
++.Op Fl p Ar file
+ .Ek
+ .Sh DESCRIPTION
+ The
+@@ -63,13 +64,16 @@
+ .Xr ntpd.conf 5 .
+ .Pp
+ The options are as follows:
+-.Bl -tag -width "-f fileXXX"
++.Bl -tag -width "-p fileXXX"
+ .It Fl d
+ Do not daemonize.
+ If this option is specified,
+ .Nm
+ will run in the foreground and log to
+ .Em stderr .
++.It Fl p Ar file
++Write pid to
++.Ar file
+ .It Fl f Ar file
+ Use
+ .Ar file
+diff -u -r openntpd-20080406p.orig/ntpd.c openntpd-20080406p/ntpd.c
+--- openntpd-20080406p.orig/ntpd.c 2013-12-01 12:49:49.774116176 -0800
++++ openntpd-20080406p/ntpd.c 2013-12-01 13:31:43.964616270 -0800
+@@ -78,7 +78,7 @@
+ {
+ extern char *__progname;
+
+- fprintf(stderr, "usage: %s [-dnSsv] [-f file]\n", __progname);
++ fprintf(stderr, "usage: %s [-dnSsv] [-f file] [-p file]\n", __progname);
+ exit(1);
+ }
+
+@@ -105,7 +105,7 @@
+ log_init(1); /* log to stderr until daemonized */
+ res_init(); /* XXX */
+
+- while ((ch = getopt(argc, argv, "df:nsSv")) != -1) {
++ while ((ch = getopt(argc, argv, "df:np:sSv")) != -1) {
+ switch (ch) {
+ case 'd':
+ lconf.debug = 1;
+@@ -116,6 +116,9 @@
+ case 'n':
+ lconf.noaction = 1;
+ break;
++ case 'p':
++ lconf.pid_file = optarg;
++ break;
+ case 's':
+ lconf.settime = 1;
+ break;
+@@ -157,9 +160,17 @@
+ reset_adjtime();
+ if (!lconf.settime) {
+ log_init(lconf.debug);
+- if (!lconf.debug)
++ if (!lconf.debug) {
+ if (daemon(1, 0))
+ fatal("daemon");
++ else if (lconf.pid_file != NULL) {
++ FILE *f = fopen(lconf.pid_file, "w");
++ if (f == NULL)
++ fatal("couldn't open pid file");
++ fprintf(f, "%ld\n", (long) getpid());
++ fclose(f);
++ }
++ }
+ } else
+ timeout = SETTIME_TIMEOUT * 1000;
+
+@@ -201,9 +212,17 @@
+ log_init(lconf.debug);
+ log_debug("no reply received in time, skipping initial "
+ "time setting");
+- if (!lconf.debug)
++ if (!lconf.debug) {
+ if (daemon(1, 0))
+ fatal("daemon");
++ else if (lconf.pid_file != NULL) {
++ FILE *f = fopen(lconf.pid_file, "w");
++ if (f == NULL)
++ fatal("couldn't open pid file");
++ fprintf(f, "%ld\n", (long) getpid());
++ fclose(f);
++ }
++ }
+ }
+
+ if (nfds > 0 && (pfd[PFD_PIPE].revents & POLLOUT))
+@@ -242,6 +261,8 @@
+ msgbuf_clear(&ibuf->w);
+ free(ibuf);
+ log_info("Terminating");
++ if (lconf.pid_file != NULL)
++ unlink(lconf.pid_file);
+ return (0);
+ }
+
+@@ -316,9 +337,17 @@
+ memcpy(&d, imsg.data, sizeof(d));
+ ntpd_settime(d);
+ /* daemonize now */
+- if (!lconf->debug)
++ if (!lconf->debug) {
+ if (daemon(1, 0))
+ fatal("daemon");
++ else if (lconf->pid_file != NULL) {
++ FILE *f = fopen(lconf->pid_file, "w");
++ if (f == NULL)
++ fatal("couldn't open pid file");
++ fprintf(f, "%ld\n", (long) getpid());
++ fclose(f);
++ }
++ }
+ lconf->settime = 0;
+ break;
+ case IMSG_HOST_DNS:
+diff -u -r openntpd-20080406p.orig/ntpd.h openntpd-20080406p/ntpd.h
+--- openntpd-20080406p.orig/ntpd.h 2013-12-01 12:49:49.773116316 -0800
++++ openntpd-20080406p/ntpd.h 2013-12-01 12:54:02.023313872 -0800
+@@ -178,6 +178,7 @@
+ u_int8_t debug;
+ u_int32_t scale;
+ u_int8_t noaction;
++ char *pid_file;
+ };
+
+ struct buf {