summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntp/ntp/ntpd
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-12-25 22:29:03 +0000
committerJoe MacDonald <joe_macdonald@mentor.com>2014-12-29 14:48:20 -0500
commitfb6b87bf67a2dbe6b50143eb8429c736f61fea2e (patch)
treeef66373b40f575e19f7f2904c0b166901d44758c /meta-networking/recipes-support/ntp/ntp/ntpd
parent3e0c561ea7a50a15f077f1a51c0cdc7a958a1c86 (diff)
downloadmeta-openembedded-fb6b87bf67a2dbe6b50143eb8429c736f61fea2e.tar.gz
ntp: upgrade to 4.2.8
* Upgrade to 4.2.8 which fixes several security issues, including CVE-2014-9293, CVE-2014-9294, CVE-2014-9295, and CVE-2014-9296. For more details please see: https://ics-cert.us-cert.gov/advisories/ICSA-14-353-01A * LIC_FILES_CHKSUM changed due to a number of copyright year and patch list changes; nothing material about the license text changed. * This version moves a number of binaries from sbindir to bindir; there's supposed to be a configure option --with-locfile=legacy to use the old layout but it does not seem to work. I guess we'll just have to live with the change. * Drop patches which are no longer applicable. * Merge inc file into recipe; there were too many changes required to the inc file in this version and it's unlikely it was much use split out in any case. * Move remaining files in files/ to ntp/ Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support/ntp/ntp/ntpd')
-rwxr-xr-xmeta-networking/recipes-support/ntp/ntp/ntpd84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd b/meta-networking/recipes-support/ntp/ntp/ntpd
new file mode 100755
index 000000000..d1b9c4907
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/ntpd
@@ -0,0 +1,84 @@
1#! /bin/sh
2
3### BEGIN INIT INFO
4# Provides: ntp
5# Required-Start: $network $remote_fs $syslog
6# Required-Stop: $network $remote_fs $syslog
7# Default-Start: 2 3 4 5
8# Default-Stop:
9# Short-Description: Start NTP daemon
10### END INIT INFO
11
12PATH=/sbin:/bin:/usr/bin:/usr/sbin
13
14DAEMON=/usr/sbin/ntpd
15PIDFILE=/var/run/ntpd.pid
16
17# ntpd init.d script for ntpdc from ntp.isc.org
18test -x $DAEMON -a -r /etc/ntp.conf || exit 0
19
20# rcS contains TICKADJ
21test -r /etc/default/rcS && . /etc/default/rcS
22
23# Source function library.
24. /etc/init.d/functions
25
26# Functions to do individual actions
27settick(){
28 # If TICKADJ is set we *must* adjust it before we start, because the
29 # driftfile relies on the correct setting
30 test -n "$TICKADJ" -a -x /usr/sbin/tickadj && {
31 echo -n "Setting tick to $TICKADJ: "
32 /usr/sbin/tickadj "$TICKADJ"
33 echo "done"
34 }
35}
36startdaemon(){
37 # The -g option allows ntpd to step the time to correct it just
38 # once. The daemon will exit if the clock drifts too much after
39 # this. If ntpd seems to disappear after a while assume TICKADJ
40 # above is set to a totally incorrect value.
41 echo -n "Starting ntpd: "
42 start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@"
43 echo "done"
44}
45stopdaemon(){
46 echo -n "Stopping ntpd: "
47 start-stop-daemon --stop --quiet --oknodo -p $PIDFILE
48 echo "done"
49}
50
51case "$1" in
52 start)
53 settick
54 startdaemon -g
55 ;;
56 stop)
57 stopdaemon
58 ;;
59 force-reload)
60 stopdaemon
61 settick
62 startdaemon -g
63 ;;
64 restart)
65 # Don't reset the tick here
66 stopdaemon
67 startdaemon -g
68 ;;
69 reload)
70 # Must do this by hand, but don't do -g
71 stopdaemon
72 startdaemon
73 ;;
74 status)
75 status /usr/sbin/ntpd;
76 exit $?
77 ;;
78 *)
79 echo "Usage: ntpd { start | stop | status | restart | reload }" >&2
80 exit 1
81 ;;
82esac
83
84exit 0