debian/0000755000000000000000000000000012256130644007171 5ustar debian/NEWS0000644000000000000000000000107212253646206007673 0ustar openntpd (20080406p-1) experimental; urgency=low Dear user, . By default, fresh openntpd installations will carry this configuration by default: . servers 0.debian.pool.ntp.org servers 1.debian.pool.ntp.org servers 2.debian.pool.ntp.org servers 3.debian.pool.ntp.org . Since this might be too intrusive to be compulsively added by an upgrade, consider adopting them at will. Please observe this and some other new features supported on the ntpd.conf(5) manual pages. -- Ulises Vitulli Thu, 08 Mar 2012 03:48:39 -0300 debian/openntpd.links0000644000000000000000000000014412253646155012067 0ustar /usr/sbin/ntpd /usr/sbin/openntpd /usr/share/man/man8/ntpd.8.gz /usr/share/man/man8/openntpd.8.gz debian/control0000644000000000000000000000217212256130521010570 0ustar Source: openntpd Section: net Priority: optional Maintainer: Ulises Vitulli Build-Depends: debhelper (>= 7), autotools-dev, autoconf, bison, libssl-dev, dpkg-dev (>= 1.16.1~) Standards-Version: 3.9.5 Homepage: http://www.openntpd.org/ Vcs-Git: git://git.debian.org/collab-maint/openntpd.git/ Vcs-Browser: http://git.debian.org/?p=collab-maint/openntpd.git Package: openntpd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, netbase Conflicts: time-daemon, ntp, chrony Replaces: time-daemon, ntp, chrony Provides: time-daemon Description: OpenBSD NTP daemon NTP, the Network Time Protocol, is used to keep the computer clocks synchronized. It provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself, redistributing the local clock. . This is an alternative implementation of the NTP software, made by the OpenBSD Project. It makes use of privilege separation, only implements a subset of the NTP protocol, adjusting the rate of the clock to synchronize the local clock. . Alternative packages which provide similar functionality are ntp and chrony. debian/openntpd.postinst0000644000000000000000000000073512253646223012634 0ustar #!/bin/sh set -e case "${1}" in configure) if ! getent passwd ntpd > /dev/null 2>&1 then adduser --quiet --system --group --no-create-home --home /var/run/openntpd ntpd fi # implemented since 20080406p-1. See #701204. touch /var/lib/openntpd/ntpd.drift chown ntpd. /var/lib/openntpd/ntpd.drift ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`${1}'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/openntpd.docs0000644000000000000000000000001712253646155011676 0ustar README CREDITS debian/openntpd.init0000644000000000000000000000331212256112177011705 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: openntpd # Required-Start: $remote_fs $network $syslog # Required-Stop: $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start openntpd at boot time # Description: NTP, the Network Time Protocol, is used to keep the # computer clocks synchronized. ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/ntpd NAME=ntpd USER=ntpd DESC=openntpd test -e /usr/sbin/openntpd || exit 0 test -f /lib/lsb/init-functions || exit 1 . /lib/lsb/init-functions # Include openntpd defaults if available if [ -f /etc/default/openntpd ]; then . /etc/default/openntpd fi DAEMON_OPTS="${DAEMON_OPTS:-} -p /var/run/openntpd.pid" set -e case "$1" in start) echo -n "Starting $DESC: " if status_of_proc "$DAEMON" $DESC > /dev/null; then log_begin_msg "Already running." else start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." fi ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --oknodo --quiet --user root --exec $DAEMON echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --oknodo --quiet --user root --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; status) start-stop-daemon --test --stop --quiet --user root --exec $DAEMON && \ log_success_msg "OpenNTPd daemon is running." || \ ( log_failure_msg "OpenNTPd daemon is NOT running" && exit 1 ) ;; check) $DAEMON $DAEMON_OPTS "-n" ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload|status|check}" >&2 exit 1 ;; esac exit 0 debian/rules0000755000000000000000000000332312253646206010255 0ustar #!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) clean: dh_testdir dh_testroot rm -f build-stamp [ ! -f Makefile ] || $(MAKE) distclean dh_clean config.status: configure dh_testdir ifneq "$(wildcard /usr/share/misc/config.sub)" "" cp -f /usr/share/misc/config.sub config.sub endif ifneq "$(wildcard /usr/share/misc/config.guess)" "" cp -f /usr/share/misc/config.guess config.guess endif autoconf ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr --mandir=\$${prefix}/share/man \ --sysconfdir=/etc/openntpd --with-privsep-user=ntpd \ --with-privsep-path=/var/lib/openntpd \ --disable-strip --localstatedir=/var/lib/openntpd build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: config.status dh_testdir $(MAKE) touch build-stamp install: build dh_testdir dh_testroot dh_prep dh_installdirs var/lib/openntpd $(MAKE) install DESTDIR=$(CURDIR)/debian/openntpd install -D -m 0755 debian/config/openntpd debian/openntpd/etc/network/if-up.d/openntpd binary: binary-arch binary-arch: build install dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs dh_installinit dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-indep: .PHONY: clean build install binary binary-arch binary-indep debian/README.source0000644000000000000000000000165012253646206011355 0ustar OpenNTPd source notes ===================== So, you are now currently at an official OpenNTPd snapshot candidate, but what does this exactly mean? Well, the OpenNTPd project has reached some maturity level, somehow a balance between features needed and bugfixing. For most projects, OpenNTPd not being the exception, arriving at this point translates into less frequent releases or no new features being delivered. This means that both, official OpenBSD and Portable (for everyone else not being OpenBSD) branches are somehow "stalled". Therefore, the OpenNTPd version you are currently on is not part of an official release announce but a snapshot candidate, produced by the official OpenNTPd Portable branch maintainer, "Darren Alan Tucker", gpg signed and available at http://dtucker.freeshell.org/openntpd/snapshot/. -- Ulises Vitulli Wed, 18 Apr 2012 13:02:29 -0300 debian/changelog0000644000000000000000000003051612256130514011044 0ustar openntpd (20080406p-7) unstable; urgency=medium * The 'Uhh-piece-of-candy!' dupload. * 06-pid.patch: re-introduce debian-specific patch for handling pidfiles (refreshed). Thanks SergeyBKirpichev for bringing it up! (Closes: #726650). * 07-dnstimeout.patch: handle DNS timeout lookups while querying for remote servers. Pulled from Gentoo, authored by PaulB.Henson (Thanks!). * Bumped up to Standards-Version 3.9.5. No changes required. -- Ulises Vitulli Mon, 16 Dec 2013 16:00:26 -0300 openntpd (20080406p-6) unstable; urgency=low * Remove driftfile at postrm when purging package (Closes: #702048). -- Ulises Vitulli Sat, 02 Mar 2013 06:14:32 -0300 openntpd (20080406p-5) unstable; urgency=low * Create driftfile at postinst script, don't mess pkg's checksums, specially for security tools like debsums. Thanks Edi Meier (Closes: #701204). * Do not reload daemon when no network interface is declared, for example, if the user brings up any network interface manually. Thanks Valery Masiutsin (Closes: #701212). -- Ulises Vitulli Fri, 22 Feb 2013 17:49:57 -0300 openntpd (20080406p-4) unstable; urgency=low * We now work on Arch: any, particularly kFreeBSD, switch from linux-any. -- Ulises Vitulli Wed, 27 Jun 2012 19:22:37 -0300 openntpd (20080406p-3) unstable; urgency=high * Include local patch, fix kFreeBSD FTBFS due to openbsd-compat layer. * Refresh local patch, avoid noisy logging on ipv4-only systems (Closes: #673761). * Enhanced hardening flags and switched to dpkg-buildflags. * Cleanning and tidying up debian/rules. -- Ulises Vitulli Wed, 27 Jun 2012 12:36:02 -0300 openntpd (20080406p-2) unstable; urgency=low * Fetched openntpd version from experimental to unstable: - Fixes tons of issues (check 20080406p-1 changelog for more information). - Drop local patches (mostly all of them upstream fixedi). - This is a upstream snapshot, please check out README.source. * Fix status target at initscript. -- Ulises Vitulli Wed, 18 Apr 2012 12:46:42 -0300 openntpd (20080406p-1) experimental; urgency=low * New upstream snapshot from OpenNTPd Portable Branch porter, fix massively amount of reported and unreported bugs (Closes: #330587, #456664). * Upstream adopted ntp_adjtime approach, functionally identical to adjtimex, drops local patch on the way (Closes: #617801). * Sadly, we currently fail != linux because some portability issues related to ntpd_adjtime. * Implemented initscript configuration checks. * Updated debian/copyright to reflect recent changes. * Introduce ntpd.drift file: - Point --localstatedir to our path. - Updated manpage with proper paths on Debian. - Updated initscript for handling proper permissionships. * Changes on local patches: -Drop 02-reconnect.patch (Fixed on upstream). -Drop 04-backslash.patch (Fixed on upstream). -Drop 05-pid.patch (Removed). -Drop 06-servernameIfInvalid.patch (Fixed on upstream). -Drop 08-adjtimex.patch.patch (Fixed on upstream). * Bumped up to Standards-Version 3.9.3. No changes required. * Report about some new features on debian/NEWS, implement it on the way. -- Ulises Vitulli Thu, 08 Mar 2012 13:19:50 -0300 openntpd (3.9p1+debian-9) unstable; urgency=low * The 'room-for-one-more?--hell-yeeeeah!' dupload. * Runtime-depend on netbase to properly handle getservbyname() calls without hardcodes (Closes: #647152). * Bumped up to Standards-Version 3.9.2.0. No changes required. * Improve building targets for simplifying portscripts. * Added collab-maint git repo at Vcs-Git and Vcs-Browser control fields. -- Ulises Vitulli Tue, 06 Dec 2011 18:05:10 -0300 openntpd (3.9p1+debian-8) unstable; urgency=low * The 'Why-do-I-run-a-buildd-If-I-never-remember-to-use-it' dupload. * Use adjtimex() patch just under linux-based ports (Closes: #306106, #419219). -- Ulises Vitulli Fri, 11 Feb 2011 07:37:21 -0300 openntpd (3.9p1+debian-7) unstable; urgency=low * The 'that-would-be-niceee' dupload. * Adopted portable openntpd's patch for adjtimex() to adjust kernel skew (Closes: #380737, #593429). * Specify which priority the events are sent to syslog (Closes: #502162). * Manpages clarification (Closes: #575705). -- Ulises Vitulli Thu, 03 Feb 2011 18:16:42 -0300 openntpd (3.9p1+debian-6) unstable; urgency=low * The 'grrrrrrrrr' dupload. * debian/initscript: - Implement 'status' method. - Report about an already running process when trying to start. - When stopping, kill parent process, instead both (Closes: #599889) thanks Graham Wilson. * Bumped up to Standards-Version 3.9.1. No changes required. -- Ulises Vitulli Wed, 13 Oct 2010 10:27:27 -0300 openntpd (3.9p1+debian-5) unstable; urgency=low * Adding missing dependency on hardening-include. -- Ulises Vitulli Wed, 09 Jun 2010 01:39:40 -0300 openntpd (3.9p1+debian-4) unstable; urgency=low * New maintainer (Closes: #543854). * The 'say-aaaaaaaaaaahh' upload. * Apply a pidfile patch, upstream doesn't like the idea of pidfiles, but sometimes they are useful for quick monitoring (Closes: #354825). * Avoid stripping by default on their own (Closes: #437691). * Dies if no peer servername is invalid, and logs badpeers through CRITICAL syslog. Thanks SergeyBKirpichev (Closes: #456661). * Depend on $network at init start and do not go through reloading if there is no listening interface declared. Thanks SergeyBKirpichev (Closes: #495528, #507586, #529984). * Explicity set default config file (Closes: #570253). * Enhance ntpd.conf manpage to verbosely remember we don't listen to any by default (Closes: #575705). * Switch to 3.0 source format, drop dependency on quilt. * Use hardening-include to handle gcc Hardening features. -- Ulises Vitulli Tue, 08 Jun 2010 16:52:01 -0300 openntpd (3.9p1+debian-3) unstable; urgency=low * Updating package to standards version 3.8.3. * Removing vcs fields. * Orphaning package. -- Daniel Baumann Thu, 27 Aug 2009 08:56:19 +0200 openntpd (3.9p1+debian-2) unstable; urgency=medium * Prefixing debhelper files with package name. * Using quilt rather than dpatch. * Applying patch from Stefan Praszalowicz to give a warning rather than fail on IPv4 only networks when seeing an IPv6 DNS record (Closes: #500676). * Applying patch from Sergey B Kirpichev to not fail if there is a backslash followed by a whitespaces in comments of the openntpd.conf (Closes: #435753). -- Daniel Baumann Sat, 10 Jan 2009 23:06:29 +0100 openntpd (3.9p1+debian-1) unstable; urgency=low * Reverting config.guess and configu.sub to upstream. * Updating package to debhelper 6. * Adding homepage field in control file. * Adding vcs fields in control file. * Removing watch file. * Updatingto debhelper 7. * Updating to standards 3.8.0. * Updating vcs fields in control file. * Using patch-stamp rather than patch in rules file. * Adding symlink from ntpd manpage to openntpd (Closes: #501552). * Replacing obsolete dh_clean -k with dh_prep. * Merging upstream version 3.9p1+debian. * Reordering rules file. * Rewriting copyright file in machine-interpretable format. * Adding upstream target in rules file. -- Daniel Baumann Sat, 08 Nov 2008 11:19:00 +0100 openntpd (3.9p1-7) unstable; urgency=low * Introducing /usr/sbin/openntpd symlink pointing and checking for that in the init script rather than for /etc/openntpd/ntpd.conf, thanks to Vincent Bernat (Closes: #423595). -- Daniel Baumann Sun, 20 Jan 2008 12:02:00 +0100 openntpd (3.9p1-6) unstable; urgency=low * Added check for existence of /etc/openntpd/ntpd.conf in init script (Closes: #423595). * Including if-up.d script as suggested by Anarcat to restart automatically when IP address changes (Closes: #457520). -- Daniel Baumann Sun, 20 Jan 2008 11:04:00 +0100 openntpd (3.9p1-5) unstable; urgency=low * New maintainer (Closes: #459495). * Rediffed reconnect.dpatch and moved config patch from diff.gz to a dpatch. * Bumped package to new policy and debhelper 5. * Some formal cleanups in debian/*. * Conditionally call deluser in postrm. * Removed a bashism in postinst. * Updated watch file to version 3. * Applied patch from Petter Reinholdtsen to add LSB formatted dependency info to the init.d script (Closes: #460227). * Improved package description as suggested by Christine Spang and Kurt Roeckx (Closes: #403432). -- Daniel Baumann Tue, 15 Jan 2008 18:11:00 +0100 openntpd (3.9p1-4) unstable; urgency=low * Reconnect after an EINVAL to make it work with dynamic IP addresses. (Closes: #392250) -- Kurt Roeckx Mon, 05 Mar 2007 18:40:48 +0100 openntpd (3.9p1-3) unstable; urgency=low * Add build dependency on groff. Manpages where installed in the cat dir instead of the man dir. (Closes: #378474) -- Kurt Roeckx Sun, 16 Jul 2006 17:51:20 +0000 openntpd (3.9p1-2) unstable; urgency=low * Make sure that the /var/run/openntpd directory exists when starting the daemon (Closes: #374166) * Use --oknodo when stopping the daemon, so that it doesn't give an error when it's not running. * Change the default config to use the debian pool as time servers. -- Kurt Roeckx Sun, 18 Jun 2006 13:25:02 +0000 openntpd (3.9p1-1) unstable; urgency=low * New upstream release - Remove getifaddrs_null.dpatch, merge upstream. * Remove the conflicts/replaces with xntp and xntp3. They're not in the archive anymore for a long time. (Closes: #316550) -- Kurt Roeckx Sun, 11 Jun 2006 12:23:45 +0000 openntpd (3.7p1-1) unstable; urgency=low * New upstream release. Removed the following patches: poll_errors.dpatch, freeifaddrs.dpatch, imsg_memmove.dpatch, network_unreachable.dpatch, daemonize_settime.dpatch. Keep: getifaddrs_null.dpatch * Remove the conflicts/replaces with xntp and xntp3. They're not in the archive anymore for a long time. (Closes: #316550) * Change Standards-Version to 3.6.2. No changes required. -- Kurt Roeckx Sat, 27 Aug 2005 17:36:57 +0200 openntpd (3.6.1p1-3) unstable; urgency=medium * getifaddrs_null.dpatch: getifaddrs() can return a interface doesn't have an address, like for instance on a ppp interface. Skip the address instead of segfaulting. Patch provided by Gabor Burjan . (Closes: #310586) -- Kurt Roeckx Tue, 24 May 2005 21:00:00 +0200 openntpd (3.6.1p1-2) unstable; urgency=medium * Change E-mail address to kurt@roeckx.be * poll_errors.dpatch: When poll() says there was an error on a socket, it didn't get checked and on the next poll() call got the same error again resulting in cpuhog. Patch from upstream CVS. (Closes: #307348) * Add a Depends on adduser since we use it in the postinst/postrm. * Use set -e in postinst/postrm instead of doing /bin/sh -e. * Create a defaults file, and mention the -s option in it. * freeifaddrs.dpatch: Call freeifaddrs() with the proper pointer. Patch from upstream CVS. * imsg_memmove.dpatch: Use a memmove() instead of memcpy() as those buffers might overlap. Patch from upstream CVS. * network_unreachable.dpatch: Do not consider ENETUNREACH as a fatal error. Patch from upstream CVS. * daemonize_settime.dpatch: When started with -s option (which isn't used by default) daemonize if sending failed instead of waiting for a reply. This might be a problem when the network is down. Patch from upstream CVS. * Remove the reload option from the init.d script since sending a SIGHUP does not work. It just sets a flag and does nothing with that. -- Kurt Roeckx Fri, 06 May 2005 15:04:54 +0200 openntpd (3.6.1p1-1) unstable; urgency=low * Initial Release. (Closes: #266022) -- Kurt Roeckx Wed, 18 Aug 2004 00:09:22 +0200 debian/openntpd.postrm0000644000000000000000000000053112253646223012267 0ustar #!/bin/sh set -e case "${1}" in purge) if [ -x /usr/sbin/deluser ] then deluser --quiet ntpd > /dev/null || true fi rm -f /var/lib/openntpd/ntpd.drift ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`${1}'" >&2 exit 1 esac #DEBHELPER# exit 0 debian/compat0000644000000000000000000000000212253646155010375 0ustar 7 debian/config/0000755000000000000000000000000012253646206010441 5ustar debian/config/openntpd0000644000000000000000000000042612253646206012215 0ustar #!/bin/sh CONFIG="/etc/openntpd/ntpd.conf" if [ "${METHOD}"X = "loopback"X ] || [ "${METHOD}"X = "none"X ] then exit 0 fi # Openntpd does not listen anything by default: if ! grep -q '^[[:space:]]*listen' "$CONFIG" then exit 0 fi invoke-rc.d openntpd force-reload || true debian/source/0000755000000000000000000000000012253646155010477 5ustar debian/source/format0000644000000000000000000000001412253646155011705 0ustar 3.0 (quilt) debian/patches/0000755000000000000000000000000012256130467010623 5ustar debian/patches/04-syslog.patch0000644000000000000000000000202012253646206013377 0ustar Author: Sergey B Kirpichev Description: Document syslog priority Bug-Debian: 502162 Index: git/ntpd.8 =================================================================== --- git.orig/ntpd.8 2012-03-08 14:21:53.000000000 -0300 +++ git/ntpd.8 2012-03-08 14:26:22.000000000 -0300 @@ -44,7 +44,8 @@ .Xr adjtime 2 system call to correct the local system time without causing time jumps. Adjustments larger than 128ms are logged using -.Xr syslog 3 . +.Xr syslog 3 +with LOG_INFO priority. The threshold value is chosen to avoid having local clock drift thrash the log files. Should @@ -101,12 +102,12 @@ .Dv SIGINFO signal, it will write its peer and sensor status to syslog. .Sh FILES -.Bl -tag -width "/var/db/ntpd.driftXXX" -compact +.Bl -tag -width "/var/lib/openntpd/ntpd.driftXXX" -compact .It Pa /etc/ntpd.conf default .Nm configuration file -.It Pa /var/db/ntpd.drift +.It Pa /var/lib/openntpd/ntpd.drift drift file, written by .Nm periodically and used at startup to get the initial clock drift debian/patches/01-use-debian-ntp-pool.patch0000644000000000000000000000106012253646206015641 0ustar Author: Dererk Description: Just use random servers from the Debian public NTP Pool diff --git a/ntpd.conf b/ntpd.conf index afe5223..b230e60 100644 --- a/ntpd.conf +++ b/ntpd.conf @@ -11,4 +11,10 @@ # use a random selection of 8 public stratum 2 servers # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers -servers pool.ntp.org +#servers pool.ntp.org + +# Choose servers announced from Debian NTP Pool +servers 0.debian.pool.ntp.org +servers 1.debian.pool.ntp.org +servers 2.debian.pool.ntp.org +servers 3.debian.pool.ntp.org debian/patches/03-manpage-no-server-by-default.patch0000644000000000000000000000147212253646206017450 0ustar Author: Dererk Description: Remark on ntpd.conf(5) manpage that Debian does not bind to any address by default. Bug-Debian: 575705 diff --git a/ntpd.conf.5 b/ntpd.conf.5 index 339685d..d57098e 100644 --- a/ntpd.conf.5 +++ b/ntpd.conf.5 @@ -47,9 +47,11 @@ Keywords may be specified multiple times within the configuration file. They are as follows: .Bl -tag -width Ds .It Ic listen on Ar address +OpenNTPd has the ability to sync the local clock to remote NTP servers and, if this directive is specified, can act as NTP server itself, redistributing the local clock. +.Pp Specify a local IP address or a hostname the .Xr ntpd 8 -daemon should listen on. +daemon should listen on to enable remote clients synchronization. If it appears multiple times, .Xr ntpd 8 will listen on each given address. debian/patches/06-pid.patch0000644000000000000000000000677512256122645012661 0ustar Description: adding a -p option to openntpd to create a pidfile Origin: https://bugs.gentoo.org/show_bug.cgi?id=493082 Reviewed-by: Sergey B Kirpichev Bug-Debian: http://bugs.debian.org/726650 Index: git/ntpd.8 =================================================================== --- git.orig/ntpd.8 2013-12-23 18:05:20.000000000 -0300 +++ git/ntpd.8 2013-12-23 18:05:20.000000000 -0300 @@ -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 Index: git/ntpd.c =================================================================== --- git.orig/ntpd.c 2013-12-23 18:05:20.000000000 -0300 +++ git/ntpd.c 2013-12-23 18:05:20.000000000 -0300 @@ -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: Index: git/ntpd.h =================================================================== --- git.orig/ntpd.h 2013-12-23 18:05:20.000000000 -0300 +++ git/ntpd.h 2013-12-23 18:05:20.000000000 -0300 @@ -178,6 +178,7 @@ u_int8_t debug; u_int32_t scale; u_int8_t noaction; + char *pid_file; }; struct buf { debian/patches/series0000644000000000000000000000025512256125426012041 0ustar 01-use-debian-ntp-pool.patch 02-warn-unsupp-servers.patch 03-manpage-no-server-by-default.patch 04-syslog.patch 05-fix-kfreebsd-ftbfs.patch 06-pid.patch 07-dnstimeout.patch debian/patches/02-warn-unsupp-servers.patch0000644000000000000000000000174712253646206016062 0ustar Author: Stefan Praszalowicz Description: Rather than fail on IPv4 only networks when seeing an IPv6 DNS record, just give a warning (Closes: #500676). Bug-Debian: 500676. Index: git/client.c =================================================================== --- git.orig/client.c 2012-06-27 15:44:21.000000000 -0300 +++ git/client.c 2012-06-27 15:45:37.000000000 -0300 @@ -135,8 +135,17 @@ struct sockaddr *sa = (struct sockaddr *)&p->addr->ss; if ((p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM, - 0)) == -1) - fatal("client_query socket"); + 0)) == -1) { + + if (errno == EAFNOSUPPORT) { + log_warn("client_query socket"); + client_nextaddr(p); + set_next(p, error_interval()); + return (-1); + } + else + fatal("client_query socket"); + } if (connect(p->query->fd, sa, SA_LEN(sa)) == -1) { if (errno == ECONNREFUSED || errno == ENETUNREACH || errno == EHOSTUNREACH || errno == EADDRNOTAVAIL) { debian/patches/05-fix-kfreebsd-ftbfs.patch0000644000000000000000000000116612253646206015545 0ustar Author: Dererk Description: Include kFreeBSD definitions when building bsd-compat layer diff --git a/openbsd-compat/bsd-adjfreq.c b/openbsd-compat/bsd-adjfreq.c index 45c404b..64e4f30 100644 --- a/openbsd-compat/bsd-adjfreq.c +++ b/openbsd-compat/bsd-adjfreq.c @@ -20,7 +20,7 @@ /* RCSID("$Id: bsd-adjfreq.c,v 1.3 2007/11/16 13:13:53 robert Exp $"); */ #if (defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) \ - || defined(__sun__)) \ + || defined(__sun__) || defined(__GNU__) || defined(__GLIBC__)) \ && !defined(HAVE_ADJFREQ) && defined(HAVE_NTP_ADJTIME) #include debian/patches/07-dnstimeout.patch0000644000000000000000000000237112256127174014267 0ustar Description: Fix DNS timeout lookup Author: Paul B. Henson Origin: https://bugs.gentoo.org/show_bug.cgi?id=493358 Index: git/ntpd.c =================================================================== --- git.orig/ntpd.c 2013-12-23 18:23:22.000000000 -0300 +++ git/ntpd.c 2013-12-23 18:23:22.000000000 -0300 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "ntpd.h" @@ -95,6 +96,7 @@ int ch, nfds, timeout = INFTIM; int pipe_chld[2]; extern char *__progname; + time_t start_time; __progname = _compat_get_progname(argv[0]); @@ -194,6 +196,8 @@ fatal(NULL); imsg_init(ibuf, pipe_chld[0]); + start_time = getmonotime(); + while (quit == 0) { pfd[PFD_PIPE].fd = ibuf->fd; pfd[PFD_PIPE].events = POLLIN; @@ -206,11 +210,12 @@ quit = 1; } - if (nfds == 0 && lconf.settime) { + if (lconf.settime && + (nfds == 0 || getmonotime() > start_time+SETTIME_TIMEOUT)) { lconf.settime = 0; timeout = INFTIM; log_init(lconf.debug); - log_debug("no reply received in time, skipping initial " + log_warnx("no reply received in time, skipping initial " "time setting"); if (!lconf.debug) { if (daemon(1, 0)) debian/copyright0000644000000000000000000003254512253646206011140 0ustar Authors: Henning Brauer Alexander Guy Download: ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/ Files: * Copyright: (C) 2003-2004 Henning Brauer (C) 2004 Alexander Guy License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: configure.ac, openbsd-compat Copyright: (C) 2004-2005 Darren Tucker (C) 1999-2004 Damien Miller (C) 1998 Todd C. Miller License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: openbsd-compat/{daemon.c,errx.c,sys-queue.h,verrx.c} Copyright: (C) 1991-1993 The Regents of the University of California License: BSD-3 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: openbsd-compat/atomicio.c Copyright: (C) 2005 Anil Madhavapeddy (C) 1995-1999 Theo de Raadt License: BSD-2 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: openbsd-compat/{atomicio.h,bsd-pool.h} Copyright: (C) 1996 Theo de Raadt License: BSD-2 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: openbsd-compat/bsd-snprintf.c Copyright: (C) 1995 Patrick Powell License: other This code is based on code written by Patrick Powell (papowell@astart.com) It may be used for any purpose as long as this notice remains intact on all source code distributions Files: defines.h, includes.h Copyright: (C) 2004-2005 Darren Tucker License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: openbsd-compat/fake-rfc2553.* Copyright: (C) 2000-2003 Damien Miller (C) 1999 WIDE Project License: BSD-3 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: openbsd-compat/port-qnx.c Copyright: (C) 2004 Anthony O.Zabelin License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: openbsd-compat/inet_pton.c Copyright: (C) 1996 Internet Software Consortium License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: mdoc2man.awk Copyright: (C) 2003 Peter Stuge License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: parse.y Copyright: (C) 2002-2004 Henning Brauer (C) 2001 Markus Friedl (C) 2001 Daniel Hartmeier (C) 2001 Theo de Raadt License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: bsd-adjfreq.c Copyright: (C) 2007 Sebastian Benoit License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: debian/* Copyright: (C) 2008 Daniel Baumann License: BSD Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. debian/openntpd.default0000644000000000000000000000036212253646155012375 0ustar # /etc/default/openntpd # Append '-s' to set the system time when starting in case the offset # between the local clock and the servers is more than 180 seconds. # For other options, see man ntpd(8). DAEMON_OPTS="-f /etc/openntpd/ntpd.conf"