diff --git a/pisi-index.xml b/pisi-index.xml index 912421c2b8..e337f4351c 100644 --- a/pisi-index.xml +++ b/pisi-index.xml @@ -16726,6 +16726,156 @@ + + + ntp + http://www.ntp.org + + PisiLinux Community + admins@pisilinux.org + + MIT + BSD + GPLv2+ + service + server + NTP daemon and client + NTP hizmeti ve istemcisi + Network Time Protocol utilities and daemons that will synchronize your computer's time to Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. + ntp, NTP protokolü üzerinden uzak sunucuları kullanarak sisteminizin zamanını eşitlemek için gerekli araçları ve hizmetleri içerir. + https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p4.tar.gz + http://sourceforge.net/projects/ictom/files/ntpstat-0.2.tar.gz + + fix-man-pages.sh + + + avahi-compat-libdns_sd-devel + libedit-devel + net-snmp-devel + perl-HTML-Parser + libcap-devel + openssl-devel + libevent-devel + + server/ntp/pspec.xml + + + ntp-server + NTP server + NTP hizmeti + + avahi-compat-libdns_sd + libedit + net-snmp + libcap + openssl + libevent + ntp-client + + + /etc/ntp.conf + /etc/conf.d + /etc/ntp/crypto + /usr/bin/ntpstat + /usr/bin/update-leap + /usr/bin/calc_tickadj + /usr/share/ntp/lib/NTP/Util.pm + /usr/libexec + /usr/sbin + /usr/share/doc + /usr/share/man + /var/lib/ntp + + + System.Package + System.Service + + + fedora/ntp.conf + fedora/ntpd.sysconfig + fedora/ntp.cryptopw + + + + ntp-client + NTP client + NTP istemcisi + app:console + util.admin + + /etc/conf.d/ntpdate + /etc/ntp/step-tickers + /etc/ntp/keys + /usr/sbin/ntpdate + /usr/share/man/man8/ntpdate.8* + + + System.Service + System.Package + + + fedora/ntpdate.sysconfig + fedora/ntp.step-tickers + fedora/ntp.keys + + + + ntp-docs + NTP documentation + NTP belgeleri + data:doc + + ntp-client + + + /usr/share/doc/ntp/html + + + + + 2016-01-01 + 4.2.8_p4 + Version Bump. + Stefan Gronewold + groni@pisilinux.org + + + 2014-07-08 + 4.2.6_p5 + Version Bump. + Vedat Demir + vedat@pisilinux.org + + + 2014-05-30 + 4.2.6_p2 + Rebuild. + Stefan Gronewold (groni) + groni@pisilinux.org + + + 2014-03-09 + 4.2.6_p2 + Rebuild. + Alihan Öztürk + alihan@pisilinux.org + + + 2013-03-06 + 4.2.6_p2 + URL Fixed + Osman Erkan + osman.erkan@pisilinux.org + + + 2011-02-16 + 4.2.6_p2 + First release + Pisi Linux Admins + admins@pisilinux.org + + + cdparanoia diff --git a/pisi-index.xml.sha1sum b/pisi-index.xml.sha1sum index e478d4f816..be2f1c9f6d 100644 --- a/pisi-index.xml.sha1sum +++ b/pisi-index.xml.sha1sum @@ -1 +1 @@ -6550d3f1ae47cb5d3a46074c48af935a1c48077c \ No newline at end of file +2963887f076b8a144c03f1a6583cddbd7115941c \ No newline at end of file diff --git a/pisi-index.xml.xz b/pisi-index.xml.xz index d8e630b2b1..c1dc8a8bf8 100644 Binary files a/pisi-index.xml.xz and b/pisi-index.xml.xz differ diff --git a/pisi-index.xml.xz.sha1sum b/pisi-index.xml.xz.sha1sum index 4952ea8d95..48153a2d0e 100644 --- a/pisi-index.xml.xz.sha1sum +++ b/pisi-index.xml.xz.sha1sum @@ -1 +1 @@ -cfed27980a6f8afd0c1d0633030b4b6dc772cab7 \ No newline at end of file +53b8e9cd923af96c4540670e941b9f7a94c0646a \ No newline at end of file diff --git a/server/ntp/actions.py b/server/ntp/actions.py new file mode 100644 index 0000000000..b0bee8e9e9 --- /dev/null +++ b/server/ntp/actions.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import shelltools +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import get + +WorkDir="%s" % get.srcDIR().replace("_", "") + +def setup(): + shelltools.export("CFLAGS", "%s -pie -fPIE -fno-strict-aliasing" % get.CFLAGS()) + + # needed to link with avahi + shelltools.export("ac_cv_header_dns_sd_h", "yes") + shelltools.export("ac_cv_lib_dns_sd_DNSServiceRegister", "yes") + + pisitools.dosed("ntpstat-0.2/Makefile", "^CC=.*gcc", "CC=%s" % get.CC()) + pisitools.dosed("ntpstat-0.2/Makefile", "^CFLAGS=.*", "CFLAGS=%s" % get.CFLAGS()) + + autotools.configure("--enable-all-clocks \ + --enable-parse-clocks \ + --enable-linuxcaps \ + --enable-ipv6 \ + --with-crypto") + +def build(): + autotools.make() + autotools.make("-C ntpstat-0.2") + + #shelltools.cd("html") + #shelltools.system("../scripts/html2man") + #shelltools.system("../fix-man-pages") + +def install(): + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) + + # Remove autotools installed man pages + pisitools.removeDir("/usr/share/man") + + # pisitools.doman("html/man/man5/*.5", "html/man/man8/*.8") + + for sbin in ["sntp", "ntpdc", "ntpd", "ntp-keygen", "ntp-wait", + "ntpq", "ntptime", "ntptrace", "tickadj", "ntpsnmpd", "ntpdate"]: + pisitools.domove("/usr/bin/%s" % sbin, "/usr/sbin") + + # Additional ntpstat binary and man page + pisitools.dobin("ntpstat-0.2/ntpstat") + pisitools.doman("ntpstat-0.2/ntpstat.1") + + pisitools.dodir("/var/lib/ntp") + + #pisitools.removeDir("/usr/lib") + + pisitools.dohtml("html/*") + pisitools.dodoc("ChangeLog", "NEWS", "README", "TODO", "WHERE-TO-START") diff --git a/server/ntp/comar/ntp-server-package.py b/server/ntp/comar/ntp-server-package.py new file mode 100644 index 0000000000..6035f682ab --- /dev/null +++ b/server/ntp/comar/ntp-server-package.py @@ -0,0 +1,8 @@ +#!/usr/bin/python + +import os + +def postInstall(fromVersion, fromRelease, toVersion, toRelease): + os.system("chown -R ntp:ntp /var/lib/ntp") + os.system("chown -R root:ntp /etc/ntp/crypto") + os.chmod("/etc/ntp/crypto", 0750) diff --git a/server/ntp/comar/ntpd-service.py b/server/ntp/comar/ntpd-service.py new file mode 100644 index 0000000000..8150b8cd6f --- /dev/null +++ b/server/ntp/comar/ntpd-service.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from comar.service import * + +import os + +serviceType = "server" +serviceDesc = _({"en": "NTP Daemon", + "tr": "NTP Hizmeti"}) +serviceConf = "ntpd" + +PIDFILE = "/run/ntpd.pid" + +@synchronized +def start(): + startService(command="/usr/sbin/ntpd", + args=config.get("OPTIONS", "-u ntp:ntp -p %s -g" % PIDFILE), + donotify=True) + +@synchronized +def stop(): + stopService(pidfile=PIDFILE, + donotify=True) + + if os.path.exists(PIDFILE): + os.unlink(PIDFILE) + +def status(): + return isServiceRunning(pidfile=PIDFILE) diff --git a/server/ntp/comar/ntpdate-package.py b/server/ntp/comar/ntpdate-package.py new file mode 100644 index 0000000000..455f7a50b6 --- /dev/null +++ b/server/ntp/comar/ntpdate-package.py @@ -0,0 +1,7 @@ +#!/usr/bin/python + +import os + +def postInstall(fromVersion, fromRelease, toVersion, toRelease): + os.system("/bin/chown root:wheel /usr/sbin/ntpdate") + os.system("/bin/chmod 04710 /usr/sbin/ntpdate") diff --git a/server/ntp/comar/ntpdate-service.py b/server/ntp/comar/ntpdate-service.py new file mode 100644 index 0000000000..4d34920ca6 --- /dev/null +++ b/server/ntp/comar/ntpdate-service.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +from comar.service import * + +import re + +serviceType = "local" +serviceDesc = _({"en": "Set the date & time via NTP", + "tr": "Tarih & zamanı NTP ile ayarlayın"}) +serviceConf = "ntpdate" +serviceDefault = "conditional" + +# ntpdate will run if it finds a ticker in any of the configuration files + +NTPCONF = "/etc/ntp.conf" +NTPSTEP = "/etc/ntp/step-tickers" +PIDFILE = "/run/ntpdate.pid" + +MSG_NOSERVER = _({"en" : "NTP server not specified in %s or %s." % (NTPSTEP, NTPCONF), + "tr" : "%s veya %s dosyasında hiç NTP sunucu belirtilmemiş." % (NTPSTEP, NTPCONF)}) + +def parse_tickers(): + tickers = [] + if os.path.exists(NTPSTEP): + for line in open(NTPSTEP, "r").read().strip().split("\n"): + if line and not line.startswith("#"): + tickers.append(line) + + if tickers: + return tickers + + if os.path.exists(NTPCONF): + for line in open(NTPCONF, "r").read().strip().split("\n"): + if line.startswith(("server", "peer")): + try: + peer = line.split()[1] + if not re.match("127\.127\.[0-9]+\.[0-9]+", peer): + tickers.append(peer) + except IndexError: + pass + + return tickers + +@synchronized +def start(): + tickers = parse_tickers() + + if len(tickers) == 0: + fail(MSG_NOSERVER) + + tickers = " ".join(tickers) + + # Eventhough the ntpdate is a oneshot process, the pidfile hack is used to + # work around COMAR's silly status() check in startService() + startService(command="/usr/sbin/ntpdate", + args="%s %s" % (config.get("OPTIONS", "-U ntp -s -b"), tickers), + makepid=True, + pidfile=PIDFILE, + donotify=True) + + if os.path.exists(PIDFILE): + os.unlink(PIDFILE) + + if config.get("SYNC_HWCLOCK", "no") == "yes": + run("/sbin/hwclock --systohc") + +def ready(): + status = is_on() + tickers = parse_tickers() + if status == "on" or (status == "conditional" and tickers): + start() + + +@synchronized +def stop(): + # There's nothing to do + pass + +def status(): + # No need to supply a status as the service is oneshot + return diff --git a/server/ntp/files/fedora/ntp-4.2.4p7-getprecision.patch b/server/ntp/files/fedora/ntp-4.2.4p7-getprecision.patch new file mode 100644 index 0000000000..ecf6defafa --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.4p7-getprecision.patch @@ -0,0 +1,12 @@ +diff -up ntp-4.2.4p7/ntpd/ntp_proto.c.getprecision ntp-4.2.4p7/ntpd/ntp_proto.c +--- ntp-4.2.4p7/ntpd/ntp_proto.c.getprecision 2009-09-29 14:16:22.000000000 +0200 ++++ ntp-4.2.4p7/ntpd/ntp_proto.c 2009-09-29 14:18:13.000000000 +0200 +@@ -3099,7 +3099,7 @@ peer_unfit( + /* + * Find the precision of this particular machine + */ +-#define MINSTEP 100e-9 /* minimum clock increment (s) */ ++#define MINSTEP 10e-9 /* minimum clock increment (s) */ + #define MAXSTEP 20e-3 /* maximum clock increment (s) */ + #define MINLOOPS 5 /* minimum number of step samples */ + diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-bcast.patch b/server/ntp/files/fedora/ntp-4.2.6p1-bcast.patch new file mode 100644 index 0000000000..8c30cf3231 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-bcast.patch @@ -0,0 +1,93 @@ +diff -up ntp-4.2.6p1/ntpd/ntp_io.c.bcast ntp-4.2.6p1/ntpd/ntp_io.c +--- ntp-4.2.6p1/ntpd/ntp_io.c.bcast 2009-12-09 08:36:37.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_io.c 2010-03-05 14:49:25.000000000 +0100 +@@ -151,6 +151,8 @@ int ninterfaces; /* Total number of in + + int disable_dynamic_updates; /* scan interfaces once only */ + ++static int pktinfo_status = 0; /* is IP_PKTINFO on wildipv4 iface enabled? */ ++ + #ifdef REFCLOCK + /* + * Refclock stuff. We keep a chain of structures with data concerning +@@ -1937,6 +1939,17 @@ set_reuseaddr( + #endif /* ! SO_EXCLUSIVEADDRUSE */ + } + ++static void ++set_pktinfo(int flag) ++{ ++ if (wildipv4 == NULL) ++ return; ++ if (setsockopt(wildipv4->fd, SOL_IP, IP_PKTINFO, &flag, sizeof (flag))) { ++ msyslog(LOG_ERR, "set_pktinfo: setsockopt(IP_PKTINFO, %s) failed: %m", flag ? "on" : "off"); ++ } else ++ pktinfo_status = flag; ++} ++ + /* + * This is just a wrapper around an internal function so we can + * make other changes as necessary later on +@@ -2374,6 +2387,7 @@ io_setbclient(void) + } + } + set_reuseaddr(0); ++ set_pktinfo(1); + if (nif > 0) + DPRINTF(1, ("io_setbclient: Opened broadcast clients\n")); + else if (!nif) +@@ -2405,6 +2419,7 @@ io_unsetbclient(void) + + socket_broadcast_disable(interf, &interf->sin); + } ++ set_pktinfo(0); + } + + /* +@@ -3130,7 +3145,8 @@ read_network_packet( + #ifdef HAVE_TIMESTAMP + struct msghdr msghdr; + struct iovec iovec; +- char control[TIMESTAMP_CTLMSGBUF_SIZE]; ++ char control[sizeof (struct cmsghdr) * 2 + sizeof (struct timeval) + ++ sizeof (struct in_pktinfo) + 32]; + #endif + + /* +@@ -3141,7 +3157,7 @@ read_network_packet( + */ + + rb = get_free_recv_buffer(); +- if (NULL == rb || itf->ignore_packets) { ++ if (NULL == rb || (itf->ignore_packets && !(pktinfo_status && itf == wildipv4))) { + char buf[RX_BUFF_SIZE]; + sockaddr_u from; + +@@ -3201,6 +3217,27 @@ read_network_packet( + return (buflen); + } + ++ if (pktinfo_status && itf->ignore_packets && itf == wildipv4) { ++ /* check for broadcast on 255.255.255.255, exception allowed on wildipv4 */ ++ struct cmsghdr *cmsg; ++ struct in_pktinfo *pktinfo = NULL; ++ ++ if ((cmsg = CMSG_FIRSTHDR(&msghdr))) ++ do { ++ if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_PKTINFO) ++ pktinfo = (struct in_pktinfo *) CMSG_DATA(cmsg); ++ } while ((cmsg = CMSG_NXTHDR(&msghdr, cmsg))); ++ if (pktinfo && pktinfo->ipi_addr.s_addr == INADDR_BROADCAST) { ++ DPRINTF(4, ("INADDR_BROADCAST\n")); ++ } else { ++ DPRINTF(4, ("%s on (%lu) fd=%d from %s\n", "ignore", ++ free_recvbuffs(), fd, stoa(&rb->recv_srcadr))); ++ packets_ignored++; ++ freerecvbuf(rb); ++ return (buflen); ++ } ++ } ++ + DPRINTF(3, ("read_network_packet: fd=%d length %d from %s\n", + fd, buflen, stoa(&rb->recv_srcadr))); + diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-cmsgalign.patch b/server/ntp/files/fedora/ntp-4.2.6p1-cmsgalign.patch new file mode 100644 index 0000000000..0e4b8ccc7a --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-cmsgalign.patch @@ -0,0 +1,14 @@ +diff -up ntp-4.2.6p1/ntpd/ntp_io.c.cmsgalign ntp-4.2.6p1/ntpd/ntp_io.c +--- ntp-4.2.6p1/ntpd/ntp_io.c.cmsgalign 2010-03-04 18:28:53.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_io.c 2010-03-04 18:30:34.000000000 +0100 +@@ -3194,8 +3194,8 @@ read_network_packet( + msghdr.msg_namelen = fromlen; + msghdr.msg_iov = &iovec; + msghdr.msg_iovlen = 1; +- msghdr.msg_control = (void *)&control; +- msghdr.msg_controllen = sizeof(control); ++ msghdr.msg_control = (void *)((long)(control + 7) & -8); /* align to 8 bytes */ ++ msghdr.msg_controllen = sizeof(control) - 8; + msghdr.msg_flags = 0; + rb->recv_length = recvmsg(fd, &msghdr, 0); + #endif diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-droproot.patch b/server/ntp/files/fedora/ntp-4.2.6p1-droproot.patch new file mode 100644 index 0000000000..4d946b2a30 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-droproot.patch @@ -0,0 +1,208 @@ +diff -up ntp-4.2.6p1/html/ntpdate.html.droproot ntp-4.2.6p1/html/ntpdate.html +--- ntp-4.2.6p1/html/ntpdate.html.droproot 2006-12-28 13:02:58.000000000 +0100 ++++ ntp-4.2.6p1/html/ntpdate.html 2010-03-03 15:32:08.000000000 +0100 +@@ -18,7 +18,7 @@ +
+

Disclaimer: The functionality of this program is now available in the ntpd program. See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page. After a suitable period of mourning, the ntpdate program is to be retired from this distribution

+

Synopsis

+- ntpdate [ -bBdoqsuv ] [ -a key ] [ -e authdelay ] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t timeout ] server [ ... ] ++ ntpdate [ -bBdoqsuv ] [ -a key ] [ -e authdelay ] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t timeout ] [ -U user_name ] server [ ... ] +

Description

+ ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs. +

ntpdate can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from a cron script. However, it is important to note that ntpdate with contrived cron scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since ntpdate does not discipline the host clock frequency as does ntpd, the accuracy using ntpdate is limited.

+@@ -58,6 +58,11 @@ +
Direct ntpdate to use an unprivileged port or outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the -d option always uses unprivileged ports. +
-v +
Be verbose. This option will cause ntpdate's version identification string to be logged. ++ ++
-U user_name
++
ntpdate process drops root privileges and changes user ID to ++ user_name and group ID to the primary group of ++ server_user. + +

Diagnostics

+ ntpdate's exit status is zero if it finds a server and updates the clock, and nonzero otherwise. +diff -up ntp-4.2.6p1/ntpdate/ntpdate.c.droproot ntp-4.2.6p1/ntpdate/ntpdate.c +--- ntp-4.2.6p1/ntpdate/ntpdate.c.droproot 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p1/ntpdate/ntpdate.c 2010-03-03 15:33:06.000000000 +0100 +@@ -48,6 +48,12 @@ + + #include + ++/* Linux capabilities */ ++#include ++#include ++#include ++#include ++ + #ifdef SYS_VXWORKS + # include "ioLib.h" + # include "sockLib.h" +@@ -152,6 +158,11 @@ int simple_query = 0; + int unpriv_port = 0; + + /* ++ * Use capabilities to drop privileges and switch uids ++ */ ++char *server_user; ++ ++/* + * Program name. + */ + char *progname; +@@ -293,6 +304,88 @@ void clear_globals() + static ni_namelist *getnetinfoservers (void); + #endif + ++/* This patch is adapted (copied) from Chris Wings drop root patch ++ * for xntpd. ++ */ ++void drop_root(uid_t server_uid, gid_t server_gid) ++{ ++ cap_t caps; ++ ++ if (prctl(PR_SET_KEEPCAPS, 1)) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "prctl(PR_SET_KEEPCAPS, 1) failed"); ++ } ++ else { ++ fprintf(stderr, "prctl(PR_SET_KEEPCAPS, 1) failed.\n"); ++ } ++ exit(1); ++ } ++ ++ if ( setgroups(0, NULL) == -1 ) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "setgroups failed."); ++ } ++ else { ++ fprintf(stderr, "setgroups failed.\n"); ++ } ++ exit(1); ++ } ++ ++ if ( setegid(server_gid) == -1 || seteuid(server_uid) == -1 ) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "setegid/seteuid to uid=%d/gid=%d failed.", server_uid, ++ server_gid); ++ } ++ else { ++ fprintf(stderr, "setegid/seteuid to uid=%d/gid=%d failed.\n", server_uid, ++ server_gid); ++ } ++ exit(1); ++ } ++ ++ caps = cap_from_text("cap_sys_time=epi"); ++ if (caps == NULL) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "cap_from_text failed."); ++ } ++ else { ++ fprintf(stderr, "cap_from_text failed.\n"); ++ } ++ exit(1); ++ } ++ ++ if (cap_set_proc(caps) == -1) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "cap_set_proc failed."); ++ } ++ else { ++ fprintf(stderr, "cap_set_proc failed.\n"); ++ } ++ exit(1); ++ } ++ ++ /* Try to free the memory from cap_from_text */ ++ cap_free( caps ); ++ ++ if ( setregid(server_gid, server_gid) == -1 || ++ setreuid(server_uid, server_uid) == -1 ) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "setregid/setreuid to uid=%d/gid=%d failed.", ++ server_uid, server_gid); ++ } ++ else { ++ fprintf(stderr, "setregid/setreuid to uid=%d/gid=%d failed.\n", ++ server_uid, server_gid); ++ } ++ exit(1); ++ } ++ ++ if (syslogit) { ++ msyslog(LOG_DEBUG, "running as uid(%d)/gid(%d) euid(%d)/egid(%d).", ++ getuid(), getgid(), geteuid(), getegid()); ++ } ++} ++ + /* + * Main program. Initialize us and loop waiting for I/O and/or + * timer expiries. +@@ -340,6 +433,8 @@ ntpdatemain ( + + init_lib(); /* sets up ipv4_works, ipv6_works */ + ++ server_user = NULL; ++ + /* Check to see if we have IPv6. Otherwise default to IPv4 */ + if (!ipv6_works) + ai_fam_templ = AF_INET; +@@ -351,7 +446,7 @@ ntpdatemain ( + /* + * Decode argument list + */ +- while ((c = ntp_getopt(argc, argv, "46a:bBde:k:o:p:qst:uv")) != EOF) ++ while ((c = ntp_getopt(argc, argv, "46a:bBde:k:o:p:qst:uvU:")) != EOF) + switch (c) + { + case '4': +@@ -429,6 +524,14 @@ ntpdatemain ( + case 'u': + unpriv_port = 1; + break; ++ case 'U': ++ if (ntp_optarg) { ++ server_user = strdup(ntp_optarg); ++ } ++ else { ++ ++errflg; ++ } ++ break; + case '?': + ++errflg; + break; +@@ -438,7 +541,7 @@ ntpdatemain ( + + if (errflg) { + (void) fprintf(stderr, +- "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n", ++ "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] [-U username] server ...\n", + progname); + exit(2); + } +@@ -544,6 +647,24 @@ ntpdatemain ( + initializing = 0; + was_alarmed = 0; + ++ if (server_user) { ++ struct passwd *pwd = NULL; ++ ++ /* Lookup server_user uid/gid before chroot/chdir */ ++ pwd = getpwnam( server_user ); ++ if ( pwd == NULL ) { ++ if (syslogit) { ++ msyslog(LOG_ERR, "Failed to lookup user '%s'.", server_user); ++ } ++ else { ++ fprintf(stderr, "Failed to lookup user '%s'.\n", server_user); ++ } ++ exit(1); ++ } ++ drop_root(pwd->pw_uid, pwd->pw_gid); ++ } ++ ++ + while (complete_servers < sys_numservers) { + #ifdef HAVE_POLL_H + struct pollfd* rdfdes; diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-logdefault.patch b/server/ntp/files/fedora/ntp-4.2.6p1-logdefault.patch new file mode 100644 index 0000000000..ae816b7419 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-logdefault.patch @@ -0,0 +1,12 @@ +diff -up ntp-4.2.6p1/ntpd/ntp_config.c.logdefault ntp-4.2.6p1/ntpd/ntp_config.c +--- ntp-4.2.6p1/ntpd/ntp_config.c.logdefault 2010-01-24 11:01:45.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_config.c 2010-03-09 17:44:09.000000000 +0100 +@@ -3794,7 +3794,7 @@ getconfig( + + #endif /* SYS_WINNT */ + res_fp = NULL; +- ntp_syslogmask = NLOG_SYNCMASK; /* set more via logconfig */ ++ ntp_syslogmask = NLOG_SYNCMASK | NLOG_EVENT | NLOG_STATUS; /* set more via logconfig */ + + /* + * install a non default variable with this daemon version diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-nano.patch b/server/ntp/files/fedora/ntp-4.2.6p1-nano.patch new file mode 100644 index 0000000000..aa1cf15985 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-nano.patch @@ -0,0 +1,18 @@ +diff -up ntp-4.2.6p1/include/ntp_syscall.h.nano ntp-4.2.6p1/include/ntp_syscall.h +--- ntp-4.2.6p1/include/ntp_syscall.h.nano 2009-12-09 08:36:37.000000000 +0100 ++++ ntp-4.2.6p1/include/ntp_syscall.h 2010-03-03 15:42:18.000000000 +0100 +@@ -14,6 +14,14 @@ + # include + #endif + ++#if defined(ADJ_NANO) && !defined(MOD_NANO) ++#define MOD_NANO ADJ_NANO ++#endif ++ ++#if defined(ADJ_TAI) && !defined(MOD_TAI) ++#define MOD_TAI ADJ_TAI ++#endif ++ + #ifndef NTP_SYSCALLS_LIBC + #ifdef NTP_SYSCALLS_STD + # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t)) diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-retcode.patch b/server/ntp/files/fedora/ntp-4.2.6p1-retcode.patch new file mode 100644 index 0000000000..6d676d274e --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-retcode.patch @@ -0,0 +1,12 @@ +diff -up ntp-4.2.6p1/ntpd/ntp_proto.c.retcode ntp-4.2.6p1/ntpd/ntp_proto.c +--- ntp-4.2.6p1/ntpd/ntp_proto.c.retcode 2009-12-09 08:36:36.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_proto.c 2010-03-03 16:06:00.000000000 +0100 +@@ -269,7 +269,7 @@ transmit( + "ntpd: no servers found"); + printf( + "ntpd: no servers found\n"); +- exit (0); ++ exit (1); + } + } + } diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-rtnetlink.patch b/server/ntp/files/fedora/ntp-4.2.6p1-rtnetlink.patch new file mode 100644 index 0000000000..2f3aa418d7 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-rtnetlink.patch @@ -0,0 +1,26 @@ +diff -up ntp-4.2.6p1/configure.rtnetlink ntp-4.2.6p1/configure +--- ntp-4.2.6p1/configure.rtnetlink 2010-02-09 11:19:49.000000000 +0100 ++++ ntp-4.2.6p1/configure 2010-03-04 17:11:50.000000000 +0100 +@@ -20579,6 +20579,7 @@ else + /* end confdefs.h. */ + + #include ++#include + #include + int + main () +diff -up ntp-4.2.6p1/ntpd/ntp_io.c.rtnetlink ntp-4.2.6p1/ntpd/ntp_io.c +--- ntp-4.2.6p1/ntpd/ntp_io.c.rtnetlink 2009-12-09 08:36:37.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_io.c 2010-03-04 17:11:32.000000000 +0100 +@@ -4304,10 +4304,7 @@ init_async_notifications() + #ifdef HAVE_RTNETLINK + memset(&sa, 0, sizeof(sa)); + sa.nl_family = PF_NETLINK; +- sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR +- | RTMGRP_IPV6_IFADDR | RTMGRP_IPV4_ROUTE +- | RTMGRP_IPV4_MROUTE | RTMGRP_IPV6_ROUTE +- | RTMGRP_IPV6_MROUTE; ++ sa.nl_groups = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR; + if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) { + msyslog(LOG_ERR, + "bind failed on routing socket (%m) - using polled interface update"); diff --git a/server/ntp/files/fedora/ntp-4.2.6p1-sleep.patch b/server/ntp/files/fedora/ntp-4.2.6p1-sleep.patch new file mode 100644 index 0000000000..577ef26eed --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p1-sleep.patch @@ -0,0 +1,495 @@ +diff -up ntp-4.2.6p1/include/ntp_refclock.h.sleep ntp-4.2.6p1/include/ntp_refclock.h +--- ntp-4.2.6p1/include/ntp_refclock.h.sleep 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p1/include/ntp_refclock.h 2010-03-10 19:27:46.000000000 +0100 +@@ -260,6 +260,7 @@ extern void refclock_control (sockaddr_u + struct refclockstat *); + extern int refclock_open (char *, u_int, u_int); + extern int refclock_setup (int, u_int, u_int); ++extern int refclock_timer_needed (struct peer *); + extern void refclock_timer (struct peer *); + extern void refclock_transmit (struct peer *); + extern int refclock_ioctl (int, u_int); +diff -up ntp-4.2.6p1/include/ntp_stdlib.h.sleep ntp-4.2.6p1/include/ntp_stdlib.h +--- ntp-4.2.6p1/include/ntp_stdlib.h.sleep 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p1/include/ntp_stdlib.h 2010-03-10 19:27:46.000000000 +0100 +@@ -116,6 +116,7 @@ extern const char * FindConfig (const ch + extern void signal_no_reset (int, RETSIGTYPE (*func)(int)); + + extern void getauthkeys (const char *); ++extern int auth_agekeys_needed (void); + extern void auth_agekeys (void); + extern void rereadkeys (void); + +diff -up ntp-4.2.6p1/include/ntpd.h.sleep ntp-4.2.6p1/include/ntpd.h +--- ntp-4.2.6p1/include/ntpd.h.sleep 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p1/include/ntpd.h 2010-03-10 19:27:46.000000000 +0100 +@@ -112,8 +112,10 @@ extern void block_io_and_alarm (void); + /* ntp_loopfilter.c */ + extern void init_loopfilter(void); + extern int local_clock(struct peer *, double); +-extern void adj_host_clock(void); ++extern int adj_host_clock_needed(void); ++extern void adj_host_clock(int); + extern void loop_config(int, double); ++extern int huffpuff_enabled(void); + extern void huffpuff(void); + extern u_long sys_clocktime; + extern u_int sys_tai; +@@ -219,6 +221,8 @@ extern void hack_restrict (int, sockaddr + /* ntp_timer.c */ + extern void init_timer (void); + extern void reinit_timer (void); ++extern double get_timeout (l_fp *); ++extern int timer_elapsed (l_fp, int); + extern void timer (void); + extern void timer_clr_stats (void); + extern void timer_interfacetimeout (u_long); +diff -up ntp-4.2.6p1/libntp/authkeys.c.sleep ntp-4.2.6p1/libntp/authkeys.c +--- ntp-4.2.6p1/libntp/authkeys.c.sleep 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p1/libntp/authkeys.c 2010-03-10 19:27:46.000000000 +0100 +@@ -445,6 +445,25 @@ auth_delkeys(void) + } + } + ++int ++auth_agekeys_needed(void) { ++ struct savekey *sk; ++ int i; ++ ++ if (authnumkeys > 20) ++ return 1; ++ ++ for (i = 0; i < HASHSIZE; i++) { ++ sk = key_hash[i]; ++ while (sk != 0) { ++ if (sk->lifetime > 0) ++ return 1; ++ sk = sk->next; ++ } ++ } ++ return 0; ++} ++ + /* + * auth_agekeys - delete keys whose lifetimes have expired + */ +diff -up ntp-4.2.6p1/ntpd/ntp_loopfilter.c.sleep ntp-4.2.6p1/ntpd/ntp_loopfilter.c +--- ntp-4.2.6p1/ntpd/ntp_loopfilter.c.sleep 2009-12-09 08:36:36.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_loopfilter.c 2010-03-10 19:27:46.000000000 +0100 +@@ -677,6 +677,13 @@ local_clock( + #endif /* LOCKCLOCK */ + } + ++int ++adj_host_clock_needed(void) ++{ ++ return !(!ntp_enable || mode_ntpdate || (pll_control && ++ kern_enable)); ++} ++ + + /* + * adj_host_clock - Called once every second to update the local clock. +@@ -686,7 +693,7 @@ local_clock( + */ + void + adj_host_clock( +- void ++ int time_elapsed + ) + { + double adjustment; +@@ -698,7 +705,7 @@ adj_host_clock( + * since the poll interval can exceed one day, the old test + * would be counterproductive. + */ +- sys_rootdisp += clock_phi; ++ sys_rootdisp += clock_phi * time_elapsed; + + #ifndef LOCKCLOCK + /* +@@ -819,6 +826,12 @@ set_freq( + #endif /* KERNEL_PLL */ + } + ++int ++huffpuff_enabled(void) ++{ ++ return sys_huffpuff != NULL; ++} ++ + /* + * huff-n'-puff filter + */ +diff -up ntp-4.2.6p1/ntpd/ntp_refclock.c.sleep ntp-4.2.6p1/ntpd/ntp_refclock.c +--- ntp-4.2.6p1/ntpd/ntp_refclock.c.sleep 2009-12-09 08:36:36.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_refclock.c 2010-03-10 19:27:46.000000000 +0100 +@@ -268,6 +268,21 @@ refclock_unpeer( + } + + ++int ++refclock_timer_needed( ++ struct peer *peer /* peer structure pointer */ ++ ) ++{ ++ u_char clktype; ++ int unit; ++ ++ clktype = peer->refclktype; ++ unit = peer->refclkunit; ++ if (refclock_conf[clktype]->clock_timer != noentry) ++ return 1; ++ return 0; ++} ++ + /* + * refclock_timer - called once per second for housekeeping. + */ +diff -up ntp-4.2.6p1/ntpd/ntp_timer.c.sleep ntp-4.2.6p1/ntpd/ntp_timer.c +--- ntp-4.2.6p1/ntpd/ntp_timer.c.sleep 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntp_timer.c 2010-03-11 15:23:59.000000000 +0100 +@@ -56,7 +56,6 @@ static u_long adjust_timer; /* second ti + static u_long stats_timer; /* stats timer */ + static u_long huffpuff_timer; /* huff-n'-puff timer */ + u_long leapsec; /* leapseconds countdown */ +-l_fp sys_time; /* current system time */ + #ifdef OPENSSL + static u_long revoke_timer; /* keys revoke timer */ + static u_long keys_timer; /* session key timer */ +@@ -74,6 +73,12 @@ volatile u_long alarm_overflow; + #define DAY (24 * HOUR) + + u_long current_time; /* seconds since startup */ ++l_fp timer_base; ++int time_elapsed; ++ ++#define TIMEOUT_TS_SIZE 2 ++l_fp timeout_ts[TIMEOUT_TS_SIZE]; ++unsigned int timeout_ts_index; + + /* + * Stats. Number of overflows and number of calls to transmit(). +@@ -110,6 +115,8 @@ static RETSIGTYPE alarming (int); + void + reinit_timer(void) + { ++ get_systime(&timer_base); ++#if 0 + #if !defined(SYS_WINNT) && !defined(VMS) + # if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) + timer_gettime(ntpd_timerid, &itimer); +@@ -143,6 +150,7 @@ reinit_timer(void) + setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0); + # endif + # endif /* VMS */ ++#endif + } + + /* +@@ -165,6 +173,12 @@ init_timer(void) + timer_xmtcalls = 0; + timer_timereset = 0; + ++ get_systime(&timer_base); ++ ++ for (timeout_ts_index = 0; timeout_ts_index < TIMEOUT_TS_SIZE; timeout_ts_index++) ++ L_CLR(&timeout_ts[timeout_ts_index]); ++ timeout_ts_index = 0; ++#if 0 + #if !defined(SYS_WINNT) + /* + * Set up the alarm interrupt. The first comes 2**EVENT_TIMEOUT +@@ -226,6 +240,7 @@ init_timer(void) + } + + #endif /* SYS_WINNT */ ++#endif + } + + #if defined(SYS_WINNT) +@@ -236,6 +251,104 @@ get_timer_handle(void) + } + #endif + ++double ++get_timeout(l_fp *now) ++{ ++ register struct peer *peer, *next_peer; ++ u_int n; ++ double r; ++ int next; ++ l_fp ts; ++ ++ ts = *now; ++ L_SUB(&ts, &timeout_ts[timeout_ts_index]); ++ timeout_ts[timeout_ts_index] = *now; ++ timeout_ts_index = (timeout_ts_index + 1) % TIMEOUT_TS_SIZE; ++ ++ /* don't waste CPU time if called too frequently */ ++ if (ts.l_ui == 0) { ++ next = 1; ++ goto finish; ++ } ++ ++ next = current_time + HOUR; ++ ++ if (adj_host_clock_needed()) { ++ next = 1; ++ goto finish; ++ } ++ for (n = 0; n < NTP_HASH_SIZE; n++) { ++ for (peer = peer_hash[n]; peer != 0; peer = next_peer) { ++ next_peer = peer->next; ++#ifdef REFCLOCK ++ if (peer->flags & FLAG_REFCLOCK && refclock_timer_needed(peer)) { ++ next = 1; ++ goto finish; ++ } ++#endif /* REFCLOCK */ ++ if (peer->action) ++ next = min(next, peer->nextaction); ++ next = min(next, peer->nextdate); ++ } ++ } ++ ++ if (leapsec > 0) ++ next = min(next, leapsec); ++ ++ if (huffpuff_enabled()) ++ next = min(next, huffpuff_timer); ++ ++#ifdef OPENSSL ++ if (auth_agekeys_needed()) ++ next = min(next, keys_timer); ++ if (sys_leap != LEAP_NOTINSYNC) ++ next = min(next, revoke_timer); ++#endif /* OPENSSL */ ++ ++ if (interface_interval) ++ next = min(next, interface_timer); ++ ++ next = min(next, stats_timer); ++ ++ next -= current_time; ++ if (next <= 0) ++ next = 1; ++finish: ++ ts = timer_base; ++ ts.l_ui += next; ++ L_SUB(&ts, now); ++ LFPTOD(&ts, r); ++#ifdef DEBUG ++ DPRINTF(2, ("timer: timeout %f\n", r)); ++#endif ++ ++ return r; ++} ++ ++int ++timer_elapsed(l_fp now, int timeout) ++{ ++ int elapsed; ++ ++ L_SUB(&now, &timer_base); ++ elapsed = now.l_i; ++ if (elapsed < 0 || elapsed > timeout + 10) { ++#ifdef DEBUG ++ DPRINTF(2, ("timer: unexpected time jump\n")); ++#endif ++ elapsed = 0; ++ reinit_timer(); ++ ++ } ++ timer_base.l_ui += elapsed; ++ time_elapsed += elapsed; ++ current_time += elapsed; ++#ifdef DEBUG ++ DPRINTF(2, ("timer: time elapsed %d\n", time_elapsed)); ++#endif ++ return time_elapsed; ++} ++ + /* + * timer - event timer + */ +@@ -251,11 +364,9 @@ timer(void) + * kiss-o'-deatch function and implement the association + * polling function.. + */ +- current_time++; +- get_systime(&sys_time); + if (adjust_timer <= current_time) { +- adjust_timer += 1; +- adj_host_clock(); ++ adjust_timer += time_elapsed; ++ adj_host_clock(time_elapsed); + #ifdef REFCLOCK + for (n = 0; n < NTP_HASH_SIZE; n++) { + for (peer = peer_hash[n]; peer != 0; peer = next_peer) { +@@ -286,7 +397,7 @@ timer(void) + * 128 s or less. + */ + if (peer->throttle > 0) +- peer->throttle--; ++ peer->throttle -= min(peer->throttle, time_elapsed); + if (peer->nextdate <= current_time) { + #ifdef REFCLOCK + if (peer->flags & FLAG_REFCLOCK) +@@ -333,7 +444,7 @@ timer(void) + * set. + */ + if (leapsec > 0) { +- leapsec--; ++ leapsec -= min(leapsec, time_elapsed); + if (leapsec == 0) { + sys_leap = LEAP_NOWARNING; + sys_tai = leap_tai; +@@ -398,11 +509,15 @@ timer(void) + * Finally, write hourly stats. + */ + if (stats_timer <= current_time) { ++ l_fp sys_time; ++ get_systime(&sys_time); + stats_timer += HOUR; + write_stats(); + if (sys_tai != 0 && sys_time.l_ui > leap_expire) + report_event(EVNT_LEAPVAL, NULL, NULL); + } ++ ++ time_elapsed = 0; + } + + +diff -up ntp-4.2.6p1/ntpd/ntpd.c.sleep ntp-4.2.6p1/ntpd/ntpd.c +--- ntp-4.2.6p1/ntpd/ntpd.c.sleep 2010-03-10 19:27:46.000000000 +0100 ++++ ntp-4.2.6p1/ntpd/ntpd.c 2010-03-10 19:27:46.000000000 +0100 +@@ -195,8 +195,6 @@ extern const char *Version; + + char const *progname; + +-int was_alarmed; +- + #ifdef DECL_SYSCALL + /* + * We put this here, since the argument profile is syscall-specific +@@ -1033,7 +1031,7 @@ getgroup: + #else /* normal I/O */ + + BLOCK_IO_AND_ALARM(); +- was_alarmed = 0; ++ + for (;;) + { + # if !defined(HAVE_SIGNALED_IO) +@@ -1041,42 +1039,39 @@ getgroup: + extern int maxactivefd; + + fd_set rdfdes; +- int nfound; +-# endif ++ int nfound, time_elapsed; + +- if (alarm_flag) /* alarmed? */ +- { +- was_alarmed = 1; +- alarm_flag = 0; +- } ++ time_elapsed = 0; ++# endif + +- if (!was_alarmed && has_full_recv_buffer() == ISC_FALSE) ++ if (has_full_recv_buffer() == ISC_FALSE) + { + /* + * Nothing to do. Wait for something. + */ + # ifndef HAVE_SIGNALED_IO ++ double timeout; ++ + rdfdes = activefds; +-# if defined(VMS) || defined(SYS_VXWORKS) +- /* make select() wake up after one second */ +- { +- struct timeval t1; ++ get_systime(&now); ++ timeout = get_timeout(&now); + +- t1.tv_sec = 1; t1.tv_usec = 0; ++ if (timeout > 0.0) { ++ struct timeval t1; ++ ++ t1.tv_sec = timeout; ++ t1.tv_usec = (timeout - t1.tv_sec) * 1000000; + nfound = select(maxactivefd+1, &rdfdes, (fd_set *)0, + (fd_set *)0, &t1); +- } +-# else +- nfound = select(maxactivefd+1, &rdfdes, (fd_set *)0, +- (fd_set *)0, (struct timeval *)0); +-# endif /* VMS */ +- if (nfound > 0) +- { +- l_fp ts; ++ get_systime(&now); ++ } else ++ nfound = 0; + +- get_systime(&ts); ++ time_elapsed = timer_elapsed(now, timeout); + +- (void)input_handler(&ts); ++ if (nfound > 0) ++ { ++ (void)input_handler(&now); + } + else if (nfound == -1 && errno != EINTR) + msyslog(LOG_ERR, "select() error: %m"); +@@ -1085,17 +1080,13 @@ getgroup: + msyslog(LOG_DEBUG, "select(): nfound=%d, error: %m", nfound); + # endif /* DEBUG */ + # else /* HAVE_SIGNALED_IO */ ++# error not supported by sleep patch + + wait_for_signal(); + # endif /* HAVE_SIGNALED_IO */ +- if (alarm_flag) /* alarmed? */ +- { +- was_alarmed = 1; +- alarm_flag = 0; +- } + } + +- if (was_alarmed) ++ if (time_elapsed > 0) + { + UNBLOCK_IO_AND_ALARM(); + /* +@@ -1103,7 +1094,6 @@ getgroup: + * to process expiry. + */ + timer(); +- was_alarmed = 0; + BLOCK_IO_AND_ALARM(); + } + +@@ -1121,19 +1111,8 @@ getgroup: + rbuf = get_full_recv_buffer(); + while (rbuf != NULL) + { +- if (alarm_flag) +- { +- was_alarmed = 1; +- alarm_flag = 0; +- } + UNBLOCK_IO_AND_ALARM(); + +- if (was_alarmed) +- { /* avoid timer starvation during lengthy I/O handling */ +- timer(); +- was_alarmed = 0; +- } +- + /* + * Call the data procedure to handle each received + * packet. diff --git a/server/ntp/files/fedora/ntp-4.2.6p2-html2man.patch b/server/ntp/files/fedora/ntp-4.2.6p2-html2man.patch new file mode 100644 index 0000000000..a82bc98745 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p2-html2man.patch @@ -0,0 +1,220 @@ +diff -up ntp-4.2.6p2/scripts/html2man.in.html2man ntp-4.2.6p2/scripts/html2man.in +--- ntp-4.2.6p2/scripts/html2man.in.html2man 2006-06-06 22:17:10.000000000 +0200 ++++ ntp-4.2.6p2/scripts/html2man.in 2010-09-15 16:56:55.000000000 +0200 +@@ -20,31 +20,33 @@ $MANDIR = "./man"; + # name of man page, man section, 'see also' section + %manfiles = ( + 'ntpd' => ['ntpd', 8, 'ntp.conf(5), ntpq(8), ntpdc(8)'], +- 'ntpq' => ['ntpq', 8, 'ntpd(8), ntpdc(8)'], ++ 'ntpq' => ['ntpq', 8, 'ntp_decode(5), ntpd(8), ntpdc(8)'], + 'ntpdate' => ['ntpdate', 8, 'ntpd(8)'], + 'ntpdc' => ['ntpdc', 8, 'ntpd(8)'], +- 'ntptime' => ['ntpdtime', 8, 'ntpd(8), ntpdate(8)'], ++ 'ntptime' => ['ntptime', 8, 'ntpd(8), ntpdate(8)'], + 'ntptrace' => ['ntptrace', 8, 'ntpd(8)'], ++ 'ntp-wait' => ['ntp-wait', 8, 'ntpd(8)'], + 'keygen' => ['ntp-keygen', 8, 'ntpd(8), ntp_auth(5)'], +- 'confopt' => ['ntp.conf', 5, 'ntpd(8)'], ++ 'tickadj' => ['tickadj', 8, 'ntpd(8)'], ++ 'confopt' => ['ntp.conf', 5, 'ntpd(8), ntp_auth(5), ntp_mon(5), ntp_acc(5), ntp_clock(5), ntp_misc(5)'], + 'authopt' => ['ntp_auth', 5, 'ntp.conf(5), ntpd(8)'], +- 'monopt' => ['ntp_mon', 5, 'ntp.conf(5)'], ++ 'monopt' => ['ntp_mon', 5, 'ntp.conf(5), ntp_decode(5)'], + 'accopt' => ['ntp_acc', 5, 'ntp.conf(5)'], + 'clockopt' => ['ntp_clock', 5, 'ntp.conf(5)'], ++ 'decode' => ['ntp_decode', 5, 'ntpq(8), ntp_mon(5)'], + 'miscopt' => ['ntp_misc', 5, 'ntp.conf(5)']); + ++%table_headers = ( ++ 'ntpd' => 'l l l l.', ++ 'ntpq' => 'l l.', ++ 'monopt' => 'l l l.', ++ 'decode' => 'l l l l.', ++ 'authopt' => 'c c c c c c.' ++); ++ + # Disclaimer to go in SEE ALSO section of the man page +-$seealso_disclaimer = 'These man pages are automatically hacked from the main NTP ' . +- 'documentation pages, which are maintained in HTML format. These files are ' . +- 'included in the NTP source distribution. If you installed NTP from a binary ' . +- 'package, or it came pre-installed on your system, chances are the documentation ' . +- 'was also included in the usual place for your system. The HTML files are more ' . +- 'correct and complete than these man pages, which are provided for your reference ' . +- 'only.'; +- +-# Disclaimer to go right at the top +-$top_disclaimer = 'This file was automatically generated from HTML source, and may be ' . +- 'incorrect. See the SEE ALSO section at the end of this file for more info'; ++$seealso_disclaimer = "HTML documentation in ntp-doc package.\n\n" . ++ "This file was automatically generated from HTML source.\n"; + + mkdir $MANDIR, 0777; + mkdir "$MANDIR/man8", 0777; +@@ -64,7 +66,8 @@ sub process { + $fileinfo = $manfiles{$filename}; + + $p = HTML::TokeParser->new("$filename.html") || die "Can't open $filename.html: $!"; +- open(MANOUT, ">$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]") ++ $fileout = "$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]"; ++ open(MANOUT, ">$fileout") + || die "Can't open: $!"; + + $p->get_tag("title"); +@@ -73,7 +76,6 @@ sub process { + + # Setup man header + print MANOUT ".TH " . $fileinfo->[0] . " " . $fileinfo->[1] . "\n"; +- print MANOUT ".UC 4\n"; + print MANOUT ".SH NAME\n"; + $pat = $fileinfo->[0]; + if ($name =~ /$pat/) { +@@ -81,10 +83,13 @@ sub process { + # Add the manpage name, if not in the HTML title already + print MANOUT "$fileinfo->[0] - "; + } +- print MANOUT "$name\n\n"; +- +- print MANOUT "$top_disclaimer\n"; ++ print MANOUT "$name\n.SH \\ \n\n"; + ++ @fontstack = (); ++ $deflevel = 0; ++ $pre = 0; ++ $ignore = 0; ++ $first_td = 1; + # Now start scanning. We basically print everything after translating some tags. + # $token->[0] has "T", "S", "E" for Text, Start, End + # $token->[1] has the tag name, or text (for "T" case) +@@ -92,19 +97,37 @@ sub process { + while (my $token = $p->get_token) { + if($token->[0] eq "T") { + my $text = $token->[1]; +- if($tag) { +- $text =~ s/^[\n ]*//; +- $text =~ s/[\n ]*$/ /; ++ if (!$pre) { ++ if($tag) { ++ $text =~ s/^[\n\t ]*//; ++ } ++ $text =~ s/^[\n\t ][\n\t ]+$//; ++ $text =~ s/[\n\t ]+/ /g; ++ $text =~ s/ \;/ /g; ++ $text =~ s/>\;/>/g; ++ $text =~ s/<\;/[0] eq "S") { + if($token->[1] eq "h4") { + my $text = uc($p->get_trimmed_text("/h4")); +- print MANOUT ".SH $text\n"; ++ # ignore these sections in ntpd.html ++ if ($filename eq "ntpd" && ++ ($text eq "CONFIGURATION OPTIONS")) { ++ $ignore = 1; ++ close(MANOUT); ++ open(MANOUT, ">/dev/null"); ++ } elsif ($ignore) { ++ $ignore = 0; ++ close(MANOUT); ++ open(MANOUT, ">>$fileout"); ++ } ++ print MANOUT "\n\n.SH $text\n"; + } + if($token->[1] eq "tt") { + push @fontstack, "tt"; +@@ -118,22 +141,42 @@ sub process { + my $text = $p->get_trimmed_text("/address"); + print MANOUT "\n.SH AUTHOR\n$text\n"; + } +- if($token->[1] eq "dt") { +- $tmp = $deflevel-4; +- print MANOUT "\n.RS $tmp\n"; ++ if($token->[1] eq "dt" || $token->[1] eq "br" && $deflevel > 0) { ++ print MANOUT "\n.TP 8\n"; + $tag = 1; + } + if($token->[1] eq "dd") { +- print MANOUT "\n.RS $deflevel\n"; ++ print MANOUT "\n"; + $tag = 1; + } + if($token->[1] eq "dl") { +- $deflevel+=4; ++ $deflevel+=1; ++ if ($deflevel > 0) { ++ print MANOUT "\n.RS ", $deflevel > 1 ? 8 : 0; ++ } ++ } ++ if($token->[1] eq "p") { ++ print MANOUT "\n"; ++ } ++ if($token->[1] eq "pre") { ++ print MANOUT "\n.nf"; ++ $pre = 1; ++ } ++ if($token->[1] eq "table") { ++ print MANOUT "\n.TS\n"; ++ print MANOUT "expand allbox tab(%);\n"; ++ print MANOUT $table_headers{$filename}; ++ print MANOUT "\n"; ++ } ++ if($token->[1] eq "td") { ++ if ($first_td == 0) { ++ print MANOUT " % "; ++ } ++ $first_td = 0; + } + } + elsif($token->[0] eq "E") { +- if($token->[1] eq "dd") { +- print MANOUT "\n.RE\n"; ++ if($token->[1] eq "h4") { + $tag = 1; + } + if($token->[1] eq "tt") { +@@ -157,15 +200,34 @@ sub process { + print MANOUT "$fontswitch"; + } + if($token->[1] eq "dl") { +- $deflevel-=4; ++ if ($deflevel > 0) { ++ print MANOUT "\n.RE"; ++ } ++ print MANOUT "\n"; ++ $deflevel-=1; + } +- if($token->[1] eq "dt") { +- print MANOUT "\n.RE"; ++ if($token->[1] eq "p") { ++ print MANOUT "\n"; + $tag = 1; + } ++ if($token->[1] eq "pre") { ++ print MANOUT "\n.fi"; ++ $pre = 0; ++ } ++ if($token->[1] eq "table") { ++ print MANOUT ".TE\n"; ++ } ++ if($token->[1] eq "tr") { ++ print MANOUT "\n"; ++ $first_td = 1; ++ } + } + } +- print MANOUT ".SH SEE ALSO\n\n"; ++ if ($ignore) { ++ close(MANOUT); ++ open(MANOUT, ">>$fileout"); ++ } ++ print MANOUT "\n.SH SEE ALSO\n\n"; + print MANOUT "$fileinfo->[2]\n\n"; + print MANOUT "$seealso_disclaimer\n"; + close(MANOUT); diff --git a/server/ntp/files/fedora/ntp-4.2.6p2-htmldoc.patch b/server/ntp/files/fedora/ntp-4.2.6p2-htmldoc.patch new file mode 100644 index 0000000000..5ec30707f1 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p2-htmldoc.patch @@ -0,0 +1,394 @@ +diff -up ntp-4.2.6p2/html/authopt.html.htmldoc ntp-4.2.6p2/html/authopt.html +--- ntp-4.2.6p2/html/authopt.html.htmldoc 2010-04-18 10:05:39.000000000 +0200 ++++ ntp-4.2.6p2/html/authopt.html 2010-07-12 16:31:43.000000000 +0200 +@@ -208,11 +208,7 @@ UTC

+ + + +- +- +- +- +- ++ + + + +@@ -368,7 +364,7 @@ UTC

+ are left unspecified, the default names are used as described below. Unless + the complete path and name of the file are specified, the location of a file + is relative to the keys directory specified in the keysdir configuration +- command or default /usr/local/etc. Following are the options. ++ command or default /etc/ntp/crypto. Following are the options. + +
+ +@@ -400,7 +396,7 @@ UTC

+
Specifies the complete path to the MD5 key file containing the keys and key IDs used by ntpd, ntpq and ntpdc when operating with symmetric key cryptography. This is the same operation as the -k command line option. Note that the directory path for Autokey media is specified by the keysdir command.
+ +
keysdir pathK
+-
This command specifies the default directory path for Autokey cryptographic keys, parameters and certificates. The default is /usr/local/etc/. Note that the path for the symmetric keys file is specified by the keys command.
++
This command specifies the default directory path for Autokey cryptographic keys, parameters and certificates. The default is /etc/ntp/crypto. Note that the path for the symmetric keys file is specified by the keys command.
+ +
requestkey keyid
+
Specifies the key ID to use with the +@@ -494,4 +490,4 @@ UTC

+ + + +- +\ No newline at end of file ++ +diff -up ntp-4.2.6p2/html/keygen.html.htmldoc ntp-4.2.6p2/html/keygen.html +--- ntp-4.2.6p2/html/keygen.html.htmldoc 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p2/html/keygen.html 2010-07-12 16:27:39.000000000 +0200 +@@ -90,7 +90,7 @@ + +

The pw option of the crypto configuration command specifies the read password for previously encrypted files. This must match the local password used by this program. If not specified, the host name is used. Thus, if files are generated by this program without password, they can be read back by ntpd without password, but only on the same host.

+ +-

All files and links are usually installed in the directory /usr/local/etc, ++

All files and links are usually installed in the directory /etc/ntp/crypto, + which is normally in a shared filesystem in NFS-mounted networks and cannot + be changed by shared clients. The location of the keys directory can be changed + by the keysdir configuration command in such cases. Normally, encrypted +@@ -101,7 +101,7 @@ + +

Running the Program

+ +-

To test and gain experience with Autokey concepts, log in as root and change to the keys directory, usually /usr/local/etc. When run for the first time, or if all files with names beginning ntpkey have been removed, use the ntp-keygen command without arguments to generate a default RSA host key and matching RSA-MD5 certificate with expiration date one year hence. If run again, the program uses the existing keys and parameters and generates only a new certificate with new expiration date one year hence; however, the certificate is not generated if the -e or -q options are present.

++

To test and gain experience with Autokey concepts, log in as root and change to the keys directory, usually /etc/ntp/crypto. When run for the first time, or if all files with names beginning ntpkey have been removed, use the ntp-keygen command without arguments to generate a default RSA host key and matching RSA-MD5 certificate with expiration date one year hence. If run again, the program uses the existing keys and parameters and generates only a new certificate with new expiration date one year hence; however, the certificate is not generated if the -e or -q options are present.

+ +

Run the command on as many hosts as necessary. Designate one of them as the trusted host (TH) using ntp-keygen with the -T option and configure it to synchronize from reliable Internet servers. Then configure the other hosts to synchronize to the TH directly or indirectly. A certificate trail is created when Autokey asks the immediately ascendant host towards the TH to sign its certificate, which is then provided to the immediately descendant host on request. All group hosts should have acyclic certificate trails ending on the TH.

+ +@@ -206,6 +206,7 @@ +

All cryptographically sound key generation schemes must have means to randomize the entropy seed used to initialize the internal pseudo-random number generator used by the OpenSSL library routines. If a site supports ssh, it is very likely that means to do this are already available. The entropy seed used by the OpenSSL library is contained in a file, usually called .rnd, which must be available when starting the ntp-keygen program or ntpd daemon.

+ +

The OpenSSL library looks for the file using the path specified by the RANDFILE environment variable in the user home directory, whether root or some other user. If the RANDFILE environment variable is not present, the library looks for the .rnd file in the user home directory. Since both the ntp-keygen program and ntpd daemon must run as root, the logical place to put this file is in /.rnd or /root/.rnd. If the file is not available or cannot be written, the program exits with a message to the system log.

++

On systems that provide /dev/urandom, the randomness device is used instead and the file specified by the randfile subcommand or the RANDFILE environment variable is ignored.

+ +

Cryptographic Data Files

+ +@@ -237,4 +238,4 @@ + + + +- +\ No newline at end of file ++ +diff -up ntp-4.2.6p2/html/ntp-wait.html.htmldoc ntp-4.2.6p2/html/ntp-wait.html +--- ntp-4.2.6p2/html/ntp-wait.html.htmldoc 2010-07-12 16:27:39.000000000 +0200 ++++ ntp-4.2.6p2/html/ntp-wait.html 2010-07-12 16:27:39.000000000 +0200 +@@ -0,0 +1,30 @@ ++ ++ ++ ++ ++ ++ ntp-wait - waits until ntpd is in synchronized state ++ ++ ++ ++

ntp-wait - waits until ntpd is in synchronized state

++
++

Synopsis

++

ntp-wait [ -v ] [ -n tries ] [ -s seconds ]

++

Description

++

The ntp-wait program blocks until ntpd is in synchronized state. ++ This can be useful at boot time, to delay the boot sequence ++ until after "ntpd -g" has set the time. ++

Command Line Options

++
++
-n tries ++
Number of tries before giving up. The default is 1000. ++
-s seconds ++
Seconds to sleep between tries. The default is 6 seconds. ++
-v ++
Be verbose. ++
++ ++ ++ ++ +diff -up ntp-4.2.6p2/html/ntpd.html.htmldoc ntp-4.2.6p2/html/ntpd.html +--- ntp-4.2.6p2/html/ntpd.html.htmldoc 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p2/html/ntpd.html 2010-07-12 16:27:39.000000000 +0200 +@@ -32,7 +32,7 @@ + +
+

Synopsis

+- ntpd [ -46aAbdDgLmnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ] ++ ntpd [ -46aAbdDgLnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I iface ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ] +

Description

+

The ntpd program is an operating system daemon that synchronises the system clock with remote NTP time servers or local reference clocks. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. The program can operate in any of several modes, as described on the Association Management page, and with both symmetric key and public key cryptography, as described on the Authentication Options page.

+

The ntpd program ordinarily requires a configuration file as desccribe on the Configuration Commands and Options collection above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the Automatic Server Discovery page.

+@@ -44,7 +44,7 @@ +

The issues should be carefully considered before using these options. The maximum slew rate possible is limited to 500 parts-per-million (PPM) by the Unix kernel. As a result, the clock can take 2000 s for each second the clock is outside the acceptable range. During this interval the clock will not be consistent with any other network clock and the system cannot be used for distributed applications that require correctly synchronized network time.

+

The frequency file, usually called ntp.drift, contains the latest estimate of clock frequency. If this file does not exist when ntpd is started, it enters a special mode designed to measure the particular frequency directly. The measurement takes 15 minutes, after which the frequency is set and ntpd resumes normal mode where the time and frequency are continuously adjusted. The frequency file is updated at intervals of an hour or more depending on the measured clock stability.

+

Operating Modes

+-

The ntpd program normally operates continuously while adjusting the time and frequency, but in some cases it may not be practical to run it continuously. With the -q option ntpd operates as in continous mode, but exits just after setting the clock for the first time. Most applications will probably want to specify the iburst option with the server command. With this option a volley of messages is exchanged to groom the data and set the clock in about 10 s. If nothing is heard after a few minutes, the daemon times out and exits.

++

The ntpd program normally operates continuously while adjusting the time and frequency, but in some cases it may not be practical to run it continuously. With the -q option ntpd operates as in continous mode, but exits just after setting the clock for the first time with the configured servers. Most applications will probably want to specify the iburst option with the server command. With this option a volley of messages is exchanged to groom the data and set the clock in about 10 s. If nothing is heard after a few minutes, the daemon times out and exits.

+

Poll Interval Control

+

NTP uses an intricate heuristic algorithm to automatically control the poll interval for maximum accuracy consistent with minimum network overhead. The algorithm measures the incidental offset and jitter to determine the best poll interval. When ntpd starts, the interval is the default minimum 64 s. Under normal conditions when the clock discipline has stabilized, the interval increases in steps to the default maximum 1024 s. In addition, should a server become unreachable after some time, the interval increases in steps to the maximum in order to reduce network overhead.

+

The default poll interval range is suitable for most conditions, but can be changed using options on the Server Options and Miscellaneous Options pages. However, when using maximum intervals much larger than the default, the residual clock frequency error must be small enough for the discipline loop to capture and correct. The capture range is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM.

+@@ -88,8 +88,13 @@ +

In contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.

+

Various internal ntpd variables can be displayed and configuration options altered while the ntpd is running using the ntpq and ntpdc utility programs.

+

When ntpd starts it looks at the value of umask, and if zero ntpd will set the umask to 022.

++

Unless the -n, -d or -D option is used, ntpd changes the current working directory to the root directory, so any options or commands specifying paths need to use an absolute path or a path relative to the root.

+

Command Line Options

+
++
-4 ++
Force DNS resolution of host names to the IPv4 namespace. ++
-6 ++
Force DNS resolution of host names to the IPv6 namespace. +
-a
+
Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the enable auth command and is the default.
+
-A
+@@ -103,7 +108,7 @@ +
-D level
+
Specify debugging level directly.
+
-f driftfile
+-
Specify the name and path of the frequency file, default /etc/ntp.drift. This is the same operation as the driftfile driftfile command.
++
Specify the name and path of the frequency file. This is the same operation as the driftfile driftfile command.
+
-g
+
Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options. See the tinker command for other options.
+
-i jaildir
+@@ -111,7 +116,7 @@ +
-I [address | interface name]
+
Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file interface command, which is more versatile.
+
-k keyfile
+-
Specify the name and path of the symmetric key file, default /etc/ntp.keys. This is the same operation as the keys keyfile command.
++
Specify the name and path of the symmetric key file. This is the same operation as the keys keyfile command.
+
-l logfile
+
Specify the name and path of the log file. The default is the system log file. This is the same operation as the logfile logfile command.
+
-L
+@@ -209,17 +214,20 @@ +
+ + +- ++ + + + + + +- +- ++ ++ + + +
ClientServer
Client/ServerNONEAUTHPC
statistics path/var/NTP/var/log/ntpstats/-sstatsdir
keys path/usr/local/etc-k/etc/ntp/cryptononekeysdir
++

Exit Codes

++

A non-zero exit code indicates an error. Any error messages are logged to the system log by default.

++

The exit code is 0 only when ntpd is terminated by a signal, or when the -q option is used and ntpd successfully sets the system clock.

+
+ + +diff -up ntp-4.2.6p2/html/ntpdate.html.htmldoc ntp-4.2.6p2/html/ntpdate.html +--- ntp-4.2.6p2/html/ntpdate.html.htmldoc 2010-07-12 16:27:39.000000000 +0200 ++++ ntp-4.2.6p2/html/ntpdate.html 2010-07-12 16:27:39.000000000 +0200 +@@ -18,9 +18,9 @@ +
+

Disclaimer: The functionality of this program is now available in the ntpd program. See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page. After a suitable period of mourning, the ntpdate program is to be retired from this distribution

+

Synopsis

+- ntpdate [ -bBdoqsuv ] [ -a key ] [ -e authdelay ] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t timeout ] [ -U user_name ] server [ ... ] ++ ntpdate [ -46bBdqsuv ] [ -a key ] [ -e authdelay ] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t timeout ] [ -U user_name ] server [ ... ] +

Description

+- ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs. ++

ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs.

+

ntpdate can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from a cron script. However, it is important to note that ntpdate with contrived cron scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since ntpdate does not discipline the host clock frequency as does ntpd, the accuracy using ntpdate is limited.

+

Time adjustments are made by ntpdate in one of two ways. If ntpdate determines the clock is in error more than 0.5 second it will simply step the time by calling the system settimeofday() routine. If the error is less than 0.5 seconds, it will slew the time by calling the system adjtime() routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when ntpdate is run by cron every hour or two.

+

ntpdate will decline to set the date if an NTP server daemon (e.g., ntpd) is running on the same host. When running ntpdate on a regular basis from cron as an alternative to running a daemon, doing so once every hour or two will result in precise enough timekeeping to avoid stepping the clock.

+@@ -33,9 +33,9 @@ +
-6 +
Force DNS resolution of following host names on the command line to the IPv6 namespace. +
-a key +-
Enable the authentication function and specify the key identifier to be used for authentication as the argument keyntpdate. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function. ++
Enable the authentication function and specify the key identifier to be used for authentication as the argument key. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function. +
-B +-
Force the time to always be slewed using the adjtime() system call, even if the measured offset is greater than +-128 ms. The default is to step the time using settimeofday() if the offset is greater than +-128 ms. Note that, if the offset is much greater than +-128 ms in this case, that it can take a long time (hours) to slew the clock to the correct value. During this time. the host should not be used to synchronize clients. ++
Force the time to always be slewed using the adjtime() system call, even if the measured offset is greater than +-500 ms. The default is to step the time using settimeofday() if the offset is greater than +-500 ms. Note that, if the offset is much greater than +-500 ms in this case, that it can take a long time (hours) to slew the clock to the correct value. During this time. the host should not be used to synchronize clients. +
-b +
Force the time to be stepped using the settimeofday() system call, rather than slewed (default) using the adjtime() system call. This option should be used when called from a startup file at boot time. +
-d +@@ -43,9 +43,9 @@ +
-e authdelay +
Specify the processing delay to perform an authentication function as the value authdelay, in seconds and fraction (see ntpd for details). This number is usually small enough to be negligible for most purposes, though specifying a value may improve timekeeping on very slow CPU's. +
-k keyfile +-
Specify the path for the authentication key file as the string keyfile. The default is /etc/ntp.keys. This file should be in the format described in ntpd. ++
Specify the path for the authentication key file as the string keyfile. The default is /etc/ntp/keys. This file should be in the format described in ntpd. +
-o version +-
Specify the NTP version for outgoing packets as the integer version, which can be 1 or 2. The default is 3. This allows ntpdate to be used with older NTP versions. ++
Specify the NTP version for outgoing packets as the integer version, which can be 1 or 2. The default is 4. This allows ntpdate to be used with older NTP versions. +
-p samples +
Specify the number of samples to be acquired from each server as the integer samples, with values from 1 to 8 inclusive. The default is 4. +
-q +@@ -55,7 +55,7 @@ +
-t timeout +
Specify the maximum time waiting for a server response as the value timeout, in seconds and fraction. The value is is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN. +
-u +-
Direct ntpdate to use an unprivileged port or outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the -d option always uses unprivileged ports. ++
Direct ntpdate to use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronize with hosts beyond the firewall. Note that the -d option always uses unprivileged ports. +
-v +
Be verbose. This option will cause ntpdate's version identification string to be logged. + +@@ -67,7 +67,7 @@ +

Diagnostics

+ ntpdate's exit status is zero if it finds a server and updates the clock, and nonzero otherwise. +

Files

+- /etc/ntp.keys - encryption keys used by ntpdate. ++ /etc/ntp/keys - encryption keys used by ntpdate. +

Bugs

+ The slew adjustment is actually 50% larger than the measured offset, since this (it is argued) will tend to keep a badly drifting clock more accurate. This is probably not a good idea and may cause a troubling hunt for some values of the kernel variables tick and tickadj.  +
+diff -up ntp-4.2.6p2/html/ntpdc.html.htmldoc ntp-4.2.6p2/html/ntpdc.html +--- ntp-4.2.6p2/html/ntpdc.html.htmldoc 2009-12-09 08:36:35.000000000 +0100 ++++ ntp-4.2.6p2/html/ntpdc.html 2010-07-12 16:27:39.000000000 +0200 +@@ -19,9 +19,9 @@ + +
+

Synopsis

+- ntpdc [ -ilnps ] [ -c command ] [ host ] [ ... ] ++ ntpdc [ -46dilnps ] [ -c command ] [ host ] [ ... ] +

Description

+- ntpdc is used to query the ntpd daemon about its current state and to request changes in that state. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the ntpdc interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using ntpdc. ++

ntpdc is used to query the ntpd daemon about its current state and to request changes in that state. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the ntpdc interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using ntpdc.

+

If one or more request options are included on the command line when ntpdc is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, ntpdc will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. ntpdc will prompt for commands if the standard input is a terminal device.

+

ntpdc uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. ntpdc makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.

+

The operation of ntpdc are specific to the particular implementation of the ntpd daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote ntpdc program which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key identifier.

+@@ -35,6 +35,8 @@ +
Force DNS resolution of following host names on the command line to the IPv6 namespace. +
-c command +
The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple -c options may be given. ++
-d ++
Turn on debugging mode. +
-i +
Force ntpdc to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. +
-l +@@ -134,11 +136,11 @@ +
addpeer peer_address [ + keyid ] [ version ] [ + minpoll# | prefer | iburst | burst | minpoll +- N | maxpoll N [...] ] ++ N | maxpoll N [...] ] +
addpeer peer_address [ + prefer | iburst | burst | minpoll + N | maxpoll N | keyid +- N | version N [...] ] ++ N | version N [...] ] +
Add a configured peer association at the + given address and operating in symmetric + active mode. Note that an existing association +@@ -162,16 +164,16 @@ + peer configuration file command of + ntpd. See the Server Options page for further information. + Each flag (or its absence) replaces the +- previous setting. The prefer keyword indicates a preferred peer (and thus will be used primarily for clock synchronisation if possible). The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal. ++ previous setting. The prefer keyword indicates a preferred peer (and thus will be used primarily for clock synchronization if possible). The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronization so is the PPS signal. + The dynamic keyword allows association configuration even when no suitable network interface is found at configuration time. The dynamic interface update mechanism may complete the configuration when new interfaces appear (e.g. WLAN/PPP interfaces) at a later time and thus render the association operable. +
addserver peer_address [ + keyid ] [ version ] [ + minpoll# | prefer | iburst | burst | minpoll +- N | maxpoll N [...] ] ++ N | maxpoll N [...] ] +
addserver peer_address [ + prefer | iburst | burst | minpoll + N | maxpoll N | keyid +- N | version N [...] ] ++ N | version N [...] ] +
Identical to the addpeer command, except that the operating mode is client. +
broadcast peer_address [ + keyid ] [ version ] [ prefer ] +@@ -200,9 +202,9 @@ +
Returns information concerning the authentication module, including known keys and counts of encryptions and decryptions which have been done. +
traps +
Display the traps set in the server. See the source listing for further information. +-
addtrap [ address [ port ] [ interface ] ++
addtrap [ address ] [ port ] [ interface ] +
Set a trap for asynchronous messages. See the source listing for further information. +-
clrtrap [ address [ port ] [ interface] ++
clrtrap [ address ] [ port ] [ interface] +
Clear a trap for asynchronous messages. See the source listing for further information. +
reset +
Clear the statistics counters in various modules of the server. See the source listing for further information. +diff -up ntp-4.2.6p2/html/ntpq.html.htmldoc ntp-4.2.6p2/html/ntpq.html +--- ntp-4.2.6p2/html/ntpq.html.htmldoc 2010-02-09 11:01:26.000000000 +0100 ++++ ntp-4.2.6p2/html/ntpq.html 2010-07-12 16:27:39.000000000 +0200 +@@ -21,7 +21,7 @@ + +
+

Synopsis

+- ntpq [-inp] [-c command] [host] [...] ++ ntpq [-46dinp] [-c command] [host] [...] +

Description

+

The ntpq utility program is used to monitor NTP daemon ntpd operations + and determine performance. It uses the standard NTP mode 6 control +@@ -591,4 +591,4 @@ + + + +- +\ No newline at end of file ++ +diff -up ntp-4.2.6p2/html/ntptrace.html.htmldoc ntp-4.2.6p2/html/ntptrace.html +--- ntp-4.2.6p2/html/ntptrace.html.htmldoc 2009-12-09 08:36:36.000000000 +0100 ++++ ntp-4.2.6p2/html/ntptrace.html 2010-07-12 16:27:39.000000000 +0200 +@@ -17,7 +17,7 @@ +
+


+

Synopsis

+- ntptrace [ -vdn ] [ -r retries ] [ -t timeout ] [ server ] ++ ntptrace [ -n ] [ -m maxhosts ] [ server ] +

Description

+

ntptrace is a perl script that uses the ntpq utility program to follow the chain of NTP servers from a given host back to the primary time source. For ntptrace to work properly, each of these servers must implement the NTP Control and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.

+

If given no arguments, ntptrace starts with localhost. Here is an example of the output from ntptrace:

+@@ -30,16 +30,8 @@ usndh.edu: stratum 1, offset 0.0019298, +

On each line, the fields are (left to right): the host name, the host stratum, the time offset between that host and the local host (as measured by ntptrace; this is why it is not always zero for "localhost"), the host synchronization distance, and (only for stratum-1 servers) the reference clock ID. All times are given in seconds. Note that the stratum is the server hop count to the primary source, while the synchronization distance is the estimated error relative to the primary source. These terms are precisely defined in RFC-1305.

+

Options

+
+-
-d +-
Turns on some debugging output. +
-n +
Turns off the printing of host names; instead, host IP addresses are given. This may be useful if a nameserver is down. +-
-r retries +-
Sets the number of retransmission attempts for each host (default = 5). +-
-t timeout +-
Sets the retransmission timeout (in seconds) (default = 2). +-
-v +-
Prints verbose information about the NTP servers. +
+

Bugs

+

This program makes no attempt to improve accuracy by doing multiple samples.

+@@ -47,4 +39,4 @@ usndh.edu: stratum 1, offset 0.0019298, + + + +- +\ No newline at end of file ++ +diff -up ntp-4.2.6p2/html/tickadj.html.htmldoc ntp-4.2.6p2/html/tickadj.html +--- ntp-4.2.6p2/html/tickadj.html.htmldoc 2009-12-09 08:36:36.000000000 +0100 ++++ ntp-4.2.6p2/html/tickadj.html 2010-07-12 16:27:39.000000000 +0200 +@@ -14,10 +14,12 @@ +

Last update: 18:53 UTC Wednesday, January 16, 2008

+
+

Synopsis

+- tickadj [ -Aqs ] [ -a tickadj ] [ -t tick ] ++

tickadj [ tick ]

++

tickadj [ -Aqs ] [ -a tickadj ] [ -t tick ]

+

Description

+

The tickadj program reads, and optionally modifies, several timekeeping-related variables in older kernels that do not have support for precision ttimekeeping, including HP-UX, SunOS, Ultrix, SGI and probably others. Those machines provide means to patch the kernel /dev/kmem. Newer machines with kernel time support, including Solaris, Tru64, FreeBSD and Linux, should NOT use the program, even if it appears to work, as it will destabilize the kernel time support. Use the ntptime program instead.

+

The particular variables that can be changed with tickadj include tick, which is the number of microseconds added to the system time for a clock interrupt, tickadj, which sets the slew rate and resolution used by the adjtime system call, and dosynctodr, which indicates to the kernels on some machines whether they should internally adjust the system clock to keep it in line with time-of-day clock or not.

++

On Linux, only the tick variable is supported and the only allowed argument is the tick value.

+

By default, with no arguments, tickadj reads the variables of interest in the kernel and displays them. At the same time, it determines an "optimal" value for the value of the tickadj variable if the intent is to run the ntpd Network Time Protocol (NTP) daemon, and prints this as well. Since the operation of tickadj when reading the kernel mimics the operation of similar parts of the ntpd program fairly closely, this can be useful when debugging problems with ntpd.

+

Note that tickadj should be run with some caution when being used for the first time on different types of machines. The operations which tickadj tries to perform are not guaranteed to work on all Unix machines and may in rare cases cause the kernel to crash.

+

Command Line Options

+@@ -43,4 +45,4 @@ + + + +- +\ No newline at end of file ++ diff --git a/server/ntp/files/fedora/ntp-4.2.6p2-mlock.patch b/server/ntp/files/fedora/ntp-4.2.6p2-mlock.patch new file mode 100644 index 0000000000..53230d41e9 --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p2-mlock.patch @@ -0,0 +1,146 @@ +diff -up ntp-4.2.6p2/html/ntpd.html.mlock ntp-4.2.6p2/html/ntpd.html +--- ntp-4.2.6p2/html/ntpd.html.mlock 2010-07-12 16:36:09.000000000 +0200 ++++ ntp-4.2.6p2/html/ntpd.html 2010-07-12 16:36:09.000000000 +0200 +@@ -32,7 +32,7 @@ + +
+

Synopsis

+- ntpd [ -46aAbdDgLnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I iface ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ] ++ ntpd [ -46aAbdDgLmnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I iface ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ] +

Description

+

The ntpd program is an operating system daemon that synchronises the system clock with remote NTP time servers or local reference clocks. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. The program can operate in any of several modes, as described on the Association Management page, and with both symmetric key and public key cryptography, as described on the Authentication Options page.

+

The ntpd program ordinarily requires a configuration file as desccribe on the Configuration Commands and Options collection above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the Automatic Server Discovery page.

+@@ -123,6 +123,8 @@ +
Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file interface command, which is more versatile.
+
-M
+
Raise scheduler precision to its maximum (1 msec) using timeBeginPeriod. (Windows only)
++
-m ++
Lock memory. +
-n
+
Don't fork.
+
-N
+diff -up ntp-4.2.6p2/ntpd/ntpd-opts.c.mlock ntp-4.2.6p2/ntpd/ntpd-opts.c +--- ntp-4.2.6p2/ntpd/ntpd-opts.c.mlock 2010-07-09 04:23:28.000000000 +0200 ++++ ntp-4.2.6p2/ntpd/ntpd-opts.c 2010-07-12 16:36:09.000000000 +0200 +@@ -284,6 +284,15 @@ tSCC zNice_Name[] = "ni + #define NICE_FLAGS (OPTST_DISABLED) + + /* ++ * Mlock option description: ++ */ ++tSCC zMlockText[] = ++ "Lock memory"; ++tSCC zMlock_NAME[] = "MLOCK"; ++tSCC zMlock_Name[] = "mlock"; ++#define MLOCK_FLAGS (OPTST_DISABLED) ++ ++/* + * Pidfile option description: + */ + tSCC zPidfileText[] = +@@ -911,6 +920,18 @@ static tOptDesc optDesc[ OPTION_CT ] = { + /* desc, NAME, name */ zPccfreqText, zPccfreq_NAME, zPccfreq_Name, + /* disablement strs */ NULL, NULL }, + ++ { /* entry idx, value */ 32, VALUE_OPT_MLOCK, ++ /* equiv idx, value */ 32, VALUE_OPT_MLOCK, ++ /* equivalenced to */ NO_EQUIVALENT, ++ /* min, max, act ct */ 0, 1, 0, ++ /* opt state flags */ MLOCK_FLAGS, 0, ++ /* last opt argumnt */ { NULL }, ++ /* arg list/cookie */ NULL, ++ /* must/cannot opts */ NULL, NULL, ++ /* option proc */ NULL, ++ /* desc, NAME, name */ zMlockText, zMlock_NAME, zMlock_Name, ++ /* disablement strs */ NULL, NULL }, ++ + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, 0, + /* equivalenced to */ NO_EQUIVALENT, +@@ -1005,7 +1026,7 @@ tOptions ntpdOptions = { + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, +- 35 /* full option count */, 32 /* user option count */, ++ 36 /* full option count */, 33 /* user option count */, + ntpd_full_usage, ntpd_short_usage, + NULL, NULL + }; +diff -up ntp-4.2.6p2/ntpd/ntpd-opts.h.mlock ntp-4.2.6p2/ntpd/ntpd-opts.h +--- ntp-4.2.6p2/ntpd/ntpd-opts.h.mlock 2010-07-09 04:23:28.000000000 +0200 ++++ ntp-4.2.6p2/ntpd/ntpd-opts.h 2010-07-12 16:36:09.000000000 +0200 +@@ -84,12 +84,13 @@ typedef enum { + INDEX_OPT_SLEW = 29, + INDEX_OPT_USEPCC = 30, + INDEX_OPT_PCCFREQ = 31, +- INDEX_OPT_VERSION = 32, +- INDEX_OPT_HELP = 33, +- INDEX_OPT_MORE_HELP = 34 ++ INDEX_OPT_MLOCK = 32, ++ INDEX_OPT_VERSION = 33, ++ INDEX_OPT_HELP = 34, ++ INDEX_OPT_MORE_HELP = 35 + } teOptIndex; + +-#define OPTION_CT 35 ++#define OPTION_CT 36 + #define NTPD_VERSION "4.2.6p2" + #define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.6p2" + +@@ -182,6 +183,10 @@ typedef enum { + # warning undefining MODIFYMMTIMER due to option name conflict + # undef MODIFYMMTIMER + # endif ++# ifdef MLOCK ++# warning undefining MLOCK due to option name conflict ++# undef MLOCK ++# endif + # ifdef NOFORK + # warning undefining NOFORK due to option name conflict + # undef NOFORK +@@ -263,6 +268,7 @@ typedef enum { + # undef LOGFILE + # undef NOVIRTUALIPS + # undef MODIFYMMTIMER ++# undef MLOCK + # undef NOFORK + # undef NICE + # undef PIDFILE +@@ -301,6 +307,7 @@ typedef enum { + #define VALUE_OPT_LOGFILE 'l' + #define VALUE_OPT_NOVIRTUALIPS 'L' + #define VALUE_OPT_MODIFYMMTIMER 'M' ++#define VALUE_OPT_MLOCK 'm' + #define VALUE_OPT_NOFORK 'n' + #define VALUE_OPT_NICE 'N' + #define VALUE_OPT_PIDFILE 'p' +diff -up ntp-4.2.6p2/ntpd/ntpd.c.mlock ntp-4.2.6p2/ntpd/ntpd.c +--- ntp-4.2.6p2/ntpd/ntpd.c.mlock 2010-07-12 16:36:09.000000000 +0200 ++++ ntp-4.2.6p2/ntpd/ntpd.c 2010-07-12 16:36:09.000000000 +0200 +@@ -722,7 +722,8 @@ ntpdmain( + } + #endif + +-#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE) ++#if defined(MCL_CURRENT) && defined(MCL_FUTURE) ++ if (HAVE_OPT( MLOCK )) { + # ifdef HAVE_SETRLIMIT + /* + * Set the stack limit to something smaller, so that we don't lock a lot +@@ -748,7 +749,7 @@ ntpdmain( + * fail if we drop root privlege. To be useful the value + * has to be larger than the largest ntpd resident set size. + */ +- rl.rlim_cur = rl.rlim_max = 32*1024*1024; ++ rl.rlim_cur = rl.rlim_max = 64*1024*1024; + if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1) { + msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m"); + } +@@ -760,6 +761,7 @@ ntpdmain( + */ + if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) + msyslog(LOG_ERR, "mlockall(): %m"); ++ } + #else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */ + # ifdef HAVE_PLOCK + # ifdef PROCLOCK diff --git a/server/ntp/files/fedora/ntp-4.2.6p2-tentative.patch b/server/ntp/files/fedora/ntp-4.2.6p2-tentative.patch new file mode 100644 index 0000000000..8f589a0eca --- /dev/null +++ b/server/ntp/files/fedora/ntp-4.2.6p2-tentative.patch @@ -0,0 +1,23 @@ +diff -up ntp-4.2.6p2/lib/isc/unix/interfaceiter.c.tentative ntp-4.2.6p2/lib/isc/unix/interfaceiter.c +--- ntp-4.2.6p2/lib/isc/unix/interfaceiter.c.tentative 2010-06-12 08:13:53.000000000 +0200 ++++ ntp-4.2.6p2/lib/isc/unix/interfaceiter.c 2010-07-12 16:25:43.000000000 +0200 +@@ -45,6 +45,8 @@ + #include + #include + ++#include ++ + /* Must follow . */ + #ifdef HAVE_NET_IF6_H + #include +@@ -252,6 +254,10 @@ linux_if_inet6_current(isc_interfaceiter + iter->current.flags |= INTERFACE_F_MULTICAST; + #endif + ++ /* ignore tentative address */ ++ if (flags & IFA_F_TENTATIVE) ++ iter->current.flags &= ~INTERFACE_F_UP; ++ + isc_netaddr_fromin6(&iter->current.address, &addr6); + if (isc_netaddr_islinklocal(&iter->current.address)) { + isc_netaddr_setzone(&iter->current.address, diff --git a/server/ntp/files/fedora/ntp.conf b/server/ntp/files/fedora/ntp.conf new file mode 100644 index 0000000000..7c0bff95c6 --- /dev/null +++ b/server/ntp/files/fedora/ntp.conf @@ -0,0 +1,59 @@ +# For more information about this file, see the man pages +# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5). + +driftfile /var/lib/ntp/drift + +# Permit time synchronization with our time source, but do not +# permit the source to query or modify the service on this system. +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery + +# Permit all access over the loopback interface. This could +# be tightened as well, but to do so would effect some of +# the administrative functions. +restrict 127.0.0.1 +restrict -6 ::1 + +# Hosts on local network are less restricted. +#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap + +# Use public servers from the pool.ntp.org project. +# Please consider joining the pool (http://www.pool.ntp.org/join.html). +server 0.pool.ntp.org +server 1.pool.ntp.org +server 2.pool.ntp.org + +peer 127.127.4.76 + +#broadcast 192.168.1.255 autokey # broadcast server +#broadcastclient # broadcast client +#broadcast 224.0.1.1 autokey # multicast server +#multicastclient 224.0.1.1 # multicast client +#manycastserver 239.255.254.254 # manycast server +#manycastclient 239.255.254.254 autokey # manycast client + +# Undisciplined Local Clock. This is a fake driver intended for backup +# and when no outside source of synchronized time is available. +#server 127.127.1.0 # local clock +#fudge 127.127.1.0 stratum 10 + +# Enable public key cryptography. +#crypto + +includefile /etc/ntp/crypto/pw + +# Key file containing the keys and key identifiers used when operating +# with symmetric key cryptography. +keys /etc/ntp/keys + +# Specify the key identifiers which are trusted. +#trustedkey 4 8 42 + +# Specify the key identifier to use with the ntpdc utility. +#requestkey 8 + +# Specify the key identifier to use with the ntpq utility. +#controlkey 8 + +# Enable writing of statistics records. +#statistics clockstats cryptostats loopstats peerstats diff --git a/server/ntp/files/fedora/ntp.cryptopw b/server/ntp/files/fedora/ntp.cryptopw new file mode 100644 index 0000000000..b76b0ca91b --- /dev/null +++ b/server/ntp/files/fedora/ntp.cryptopw @@ -0,0 +1,4 @@ +# Specify the password to decrypt files containing private keys and identity +# parameters. This is required only if these files have been encrypted. +# +#crypto pw apassword diff --git a/server/ntp/files/fedora/ntp.keys b/server/ntp/files/fedora/ntp.keys new file mode 100644 index 0000000000..5500a718ba --- /dev/null +++ b/server/ntp/files/fedora/ntp.keys @@ -0,0 +1,5 @@ +# +# PLEASE DO NOT USE THE DEFAULT VALUES HERE. +# +#65535 M akey +#1 M pass diff --git a/server/ntp/files/fedora/ntp.step-tickers b/server/ntp/files/fedora/ntp.step-tickers new file mode 100644 index 0000000000..92b33c90ec --- /dev/null +++ b/server/ntp/files/fedora/ntp.step-tickers @@ -0,0 +1 @@ +# List of servers used for initial synchronization. diff --git a/server/ntp/files/fedora/ntpd.sysconfig b/server/ntp/files/fedora/ntpd.sysconfig new file mode 100644 index 0000000000..800a722535 --- /dev/null +++ b/server/ntp/files/fedora/ntpd.sysconfig @@ -0,0 +1,2 @@ +# Drop root to id 'ntp:ntp' by default. +OPTIONS="-u ntp:ntp -p /run/ntpd.pid -g" diff --git a/server/ntp/files/fedora/ntpdate.sysconfig b/server/ntp/files/fedora/ntpdate.sysconfig new file mode 100644 index 0000000000..667093a342 --- /dev/null +++ b/server/ntp/files/fedora/ntpdate.sysconfig @@ -0,0 +1,5 @@ +# Options for ntpdate +OPTIONS="-U ntp -s -b" + +# Set to 'yes' to sync hw clock after successful ntpdate +SYNC_HWCLOCK=no diff --git a/server/ntp/files/fedora/ntpstat-0.2-multipacket.patch b/server/ntp/files/fedora/ntpstat-0.2-multipacket.patch new file mode 100644 index 0000000000..c75c8320b7 --- /dev/null +++ b/server/ntp/files/fedora/ntpstat-0.2-multipacket.patch @@ -0,0 +1,12 @@ +diff -up ntp-4.2.4p7/ntpstat-0.2/ntpstat.c.ntpstat ntp-4.2.4p7/ntpstat-0.2/ntpstat.c +--- ntpstat-0.2/ntpstat.c.ntpstat 2002-06-10 08:02:12.000000000 +0200 ++++ ntpstat-0.2/ntpstat.c 2009-07-20 12:22:35.000000000 +0200 +@@ -151,7 +151,7 @@ int main (void) { + /* For the reply message to be valid, the first byte should be as sent, + and the second byte should be the same, with the response bit set */ + byte1ok = ((ntpmsg.byte1&0x3F) == B1VAL); +- byte2ok = (ntpmsg.byte2 == (B2VAL|RMASK)); ++ byte2ok = ((ntpmsg.byte2 & ~MMASK) == (B2VAL|RMASK)); + if (!(byte1ok && byte2ok)) { + fprintf (stderr,"status word is 0x%02x%02x\n", ntpmsg.byte1,ntpmsg.byte2 ); + die ("return data appears to be invalid based on status word"); diff --git a/server/ntp/files/fedora/ntpstat-0.2-sysvars.patch b/server/ntp/files/fedora/ntpstat-0.2-sysvars.patch new file mode 100644 index 0000000000..c883359d8f --- /dev/null +++ b/server/ntp/files/fedora/ntpstat-0.2-sysvars.patch @@ -0,0 +1,15 @@ +diff -up ntp-4.2.6p1/ntpstat-0.2/ntpstat.c.sysvars ntp-4.2.6p1/ntpstat-0.2/ntpstat.c +--- ntpstat-0.2/ntpstat.c.sysvars 2010-05-03 11:27:47.000000000 +0200 ++++ ntpstat-0.2/ntpstat.c 2010-05-03 11:32:56.000000000 +0200 +@@ -89,9 +89,9 @@ int main (void) { + "modem"}; /* 9 */ + char *newstr; + char *dispstr; +- const char DISP[] = "rootdispersion="; ++ const char DISP[] = "rootdisp="; + const char STRATUM[] = "stratum="; +- const char POLL[] = "poll="; ++ const char POLL[] = "tc="; + const char REFID[] = "refid="; + + /* initialise timeout value */ diff --git a/server/ntp/files/fix-man-pages.sh b/server/ntp/files/fix-man-pages.sh new file mode 100644 index 0000000000..475916996a --- /dev/null +++ b/server/ntp/files/fix-man-pages.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# remove adjacent blank lines +sed -i 's/^[\t\ ]*$//;/./,/^$/!d' man/man*/*.[58] + +#sed -i 's/sntp\.1/sntp\.8/' man/man1/sntp.1 +#mv man/man1/sntp.1 man/man8/sntp.8 + +# fix section numbers +sed -i 's/\(\.TH[a-zA-Z ]*\)[1-9]\(.*\)/\18\2/' man/man8/*.8 diff --git a/server/ntp/files/ntp.conf b/server/ntp/files/ntp.conf new file mode 100644 index 0000000000..5fd22003f5 --- /dev/null +++ b/server/ntp/files/ntp.conf @@ -0,0 +1,52 @@ +## /etc/ntp/ntp.conf +## +## Sample NTP configuration file. +## See package 'ntp-doc' for documentation, Mini-HOWTO and FAQ. + +## Radio and modem clocks by convention have addresses in the +## form 127.127.t.u, where t is the clock type and u is a unit +## number in the range 0-3. +## +## Most of these clocks require support in the form of a +## serial port or special bus peripheral. The particular +## device is normally specified by adding a soft link +## /dev/device-u to the particular hardware device involved, +## where u correspond to the unit number above. +## +## Generic DCF77 clock on serial port (Conrad DCF77) +## Address: 127.127.8.u +## Serial Port: /dev/refclock-u +## +## (create soft link /dev/refclock-0 to the particular ttyS?) +## +# server 127.127.8.0 mode 5 prefer + +## Undisciplined Local Clock. This is a fake driver intended for backup +## and when no outside source of synchronized time is available. +## +server 127.127.1.0 # local clock (LCL) +fudge 127.127.1.0 stratum 10 # LCL is unsynchronized + +## Outside source of synchronized time +## +## server xx.xx.xx.xx # IP address of server + +## Miscellaneous stuff + +driftfile /var/lib/ntp/drift/ntp.drift # path for drift file + +logfile /var/log/ntp # alternate log file +# logconfig =syncstatus + sysevents +# logconfig =all + +# statsdir /tmp/ # directory for statistics files +# filegen peerstats file peerstats type day enable +# filegen loopstats file loopstats type day enable +# filegen clockstats file clockstats type day enable + +# Authentication stuff +# +# keys /etc/ntp.keys # path for keys file +# trustedkey 1 2 3 4 5 6 14 15 # define trusted keys +# requestkey 15 # key (7) for accessing server variables +# controlkey 15 # key (6) for accessing server variables diff --git a/server/ntp/pspec.xml b/server/ntp/pspec.xml new file mode 100644 index 0000000000..315d974fec --- /dev/null +++ b/server/ntp/pspec.xml @@ -0,0 +1,171 @@ + + + + + ntp + http://www.ntp.org + + PisiLinux Community + admins@pisilinux.org + + MIT + BSD + GPLv2+ + service + NTP daemon and client + Network Time Protocol utilities and daemons that will synchronize your computer's time to Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. + https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p4.tar.gz + http://sourceforge.net/projects/ictom/files/ntpstat-0.2.tar.gz + + fix-man-pages.sh + + + avahi-compat-libdns_sd-devel + libedit-devel + net-snmp-devel + perl-HTML-Parser + libcap-devel + openssl-devel + libevent-devel + + + + + + + ntp-server + NTP server + + avahi-compat-libdns_sd + libedit + net-snmp + libcap + openssl + libevent + ntp-client + + + /etc/ntp.conf + /etc/conf.d + /etc/ntp/crypto + /usr/bin/ntpstat + /usr/bin/update-leap + /usr/bin/calc_tickadj + /usr/share/ntp/lib/NTP/Util.pm + /usr/libexec + /usr/sbin + /usr/share/doc + /usr/share/man + /var/lib/ntp + + + fedora/ntp.conf + fedora/ntpd.sysconfig + fedora/ntp.cryptopw + + + System.Package + System.Service + + + + + ntp-client + app:console + util.admin + NTP client + + /etc/conf.d/ntpdate + /etc/ntp/step-tickers + /etc/ntp/keys + /usr/sbin/ntpdate + /usr/share/man/man8/ntpdate.8* + + + fedora/ntpdate.sysconfig + fedora/ntp.step-tickers + fedora/ntp.keys + + + System.Service + + System.Package + + + + + ntp-docs + data:doc + NTP documentation + + ntp-client + + + /usr/share/doc/ntp/html + + + + + + 2016-01-01 + 4.2.8_p4 + Version Bump. + Stefan Gronewold + groni@pisilinux.org + + + 2014-07-08 + 4.2.6_p5 + Version Bump. + Vedat Demir + vedat@pisilinux.org + + + 2014-05-30 + 4.2.6_p2 + Rebuild. + Stefan Gronewold (groni) + groni@pisilinux.org + + + 2014-03-09 + 4.2.6_p2 + Rebuild. + Alihan Öztürk + alihan@pisilinux.org + + + 2013-03-06 + 4.2.6_p2 + URL Fixed + Osman Erkan + osman.erkan@pisilinux.org + + + 2011-02-16 + 4.2.6_p2 + First release + Pisi Linux Admins + admins@pisilinux.org + + + diff --git a/server/ntp/translations.xml b/server/ntp/translations.xml new file mode 100644 index 0000000000..a093d732a7 --- /dev/null +++ b/server/ntp/translations.xml @@ -0,0 +1,23 @@ + + + + ntp + NTP hizmeti ve istemcisi + ntp, NTP protokolü üzerinden uzak sunucuları kullanarak sisteminizin zamanını eşitlemek için gerekli araçları ve hizmetleri içerir. + + + + ntp-server + NTP hizmeti + + + + ntp-client + NTP istemcisi + + + + ntp-docs + NTP belgeleri + +