ntp: Fix/complete update to 4.2.8p1

This new version of ntp has quite a number of changes, e.g.
certain utilities requiring perl, and some programs are now in
/usr/sbin rather than /usr/bin.
This commit is contained in:
Harald Welte 2015-02-20 14:29:46 +01:00
parent 42d9a2747f
commit 4235a5776f
7 changed files with 32 additions and 24 deletions

View File

@ -2,24 +2,24 @@
FLAGS="defaults 23"
test -f /usr/bin/ntpd || exit 0
test -f /usr/sbin/ntpd || exit 0
case "$1" in
start)
echo -n "Starting NTP server: ntpd"
start-stop-daemon --start --quiet --exec /usr/bin/ntpd
start-stop-daemon --start --quiet --exec /usr/sbin/ntpd
echo "."
;;
stop)
echo -n "Stopping NTP server: ntpd"
start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
start-stop-daemon --stop --quiet --exec /usr/sbin/ntpd
echo "."
;;
restart|force-reload)
echo -n "Restarting NTP server: ntpd... "
start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
start-stop-daemon --stop --quiet --exec /usr/sbin/ntpd
sleep 2
start-stop-daemon --start --quiet --exec /usr/bin/ntpd
start-stop-daemon --start --quiet --exec /usr/sbin/ntpd
echo "done."
;;
*)

View File

@ -1,7 +1,7 @@
#! /bin/sh
#
# ntpd init.d script for ntpdc from ntp.isc.org
test -x /usr/bin/ntpd -a -r /etc/ntp.conf || exit 0
test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0
# rcS contains TICKADJ
test -r /etc/default/rcS && . /etc/default/rcS
@ -9,9 +9,9 @@ test -r /etc/default/rcS && . /etc/default/rcS
settick(){
# If TICKADJ is set we *must* adjust it before we start, because the
# driftfile relies on the correct setting
test -n "$TICKADJ" -a -x /usr/bin/tickadj && {
test -n "$TICKADJ" -a -x /usr/sbin/tickadj && {
echo -n "Setting tick to $TICKADJ: "
/usr/bin/tickadj "$TICKADJ"
/usr/sbin/tickadj "$TICKADJ"
echo "done"
}
}
@ -21,7 +21,7 @@ startdaemon(){
# this. If ntpd seems to disappear after a while assume TICKADJ
# above is set to a totally incorrect value.
echo -n "Starting ntpd: "
start-stop-daemon --start -x /usr/bin/ntpd -- -p /var/run/ntp.pid "$@"
start-stop-daemon --start -x /usr/sbin/ntpd -- -p /var/run/ntp.pid "$@"
echo "done"
}
stopdaemon(){

View File

@ -5,7 +5,7 @@ After=network.target
[Service]
Type=forking
PIDFile=/run/ntpd.pid
ExecStart=/usr/bin/ntpd -p /run/ntpd.pid
ExecStart=/usr/sbin/ntpd -p /run/ntpd.pid
[Install]
WantedBy=multi-user.target

View File

@ -2,7 +2,7 @@
PATH=/sbin:/bin:/usr/bin
test -x /usr/bin/ntpdate || exit 0
test -x /usr/sbin/ntpdate || exit 0
if test -f /etc/default/ntpdate ; then
. /etc/default/ntpdate
@ -35,7 +35,7 @@ if [ -x /usr/bin/lockfile-create ]; then
LOCKTOUCHPID="$!"
fi
if /usr/bin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
if [ "$UPDATE_HWCLOCK" = "yes" ]; then
hwclock --systohc || :
fi

View File

@ -4,7 +4,7 @@ Before=ntpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/ntpd -q -g -x
ExecStart=/usr/sbin/ntpd -q -g -x
RemainAfterExit=yes
[Install]

View File

@ -5,7 +5,6 @@ or satellite receiver or modem."
HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome"
SECTION = "console/network"
LICENSE = "ntp"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670"
RSUGGESTS_${PN} = "iana-etc"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \

View File

@ -1,6 +1,6 @@
require ntp.inc
PR = "r3"
PR = "r5"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://ntp-4.2.4_p6-nano.patch \
@ -10,12 +10,15 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://ntpdate.service \
file://ntpd.service \
"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f41fedb22dffefcbfafecc85b0f79cfa"
SRC_URI[md5sum] = "65d8cdfae4722226fbe29863477641ed"
SRC_URI[sha256sum] = "948274b88f1ed002d867ced6aaefdfd0999668b11285ac2b3a67ff2629d59d88"
EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd --with-yielding-select=yes"
PACKAGES += "${PN}-perl"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
@ -31,24 +34,30 @@ do_install_append() {
ln -sf ../ntpd.service ${D}${systemd_unitdir}/system/multi-user.target.wants/
}
FILES_${PN}-bin = "${bindir}/ntp-wait \
${bindir}/ntpdc \
${bindir}/ntpq \
FILES_${PN}-bin = "${sbindir}/ntp-wait \
${sbindir}/ntpdc \
${sbindir}/ntpq \
${bindir}/ntptime \
${bindir}/ntptrace"
${sbindir}/ntptrace"
FILES_${PN} = "${bindir}/ntpd \
FILES_${PN} = "${sbindir}/ntpd \
${libdir}/ntp \
${sysconfdir}/ntp.conf \
${sysconfdir}/init.d/ntpd \
${systemd_unitdir}/system/ntpd.service \
${systemd_unitdir}/system/multi-user.target.wants/ntpd.service"
FILES_${PN}-tickadj = "${bindir}/tickadj"
FILES_ntp-utils = "${bindir}/*"
FILES_ntpdate = "${bindir}/ntpdate \
FILES_${PN}-tickadj = "${sbindir}/tickadj"
FILES_ntp-perl = "${prefix}/share/ntp/lib/NTP/Util.pm \
${bindir}/ntpsweep ${bindir}/ntptrace \
${sbindir}/calc_tickadj ${sbindir}/ntp-wait"
FILES_ntpdate = "${sbindir}/ntpdate \
${sysconfdir}/network/if-up.d/ntpdate \
${systemd_unitdir}/system/ntpdate.service \
${systemd_unitdir}/system/multi-user.target.wants/ntpdate.service"
FILES_ntp-utils = "${sbindir}/* ${bindir}/*"
DEPENDS_${PN}-perl = "perl"
# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
# with wonky clocks (e.g. OpenSlug)
@ -61,7 +70,7 @@ else
if ! grep -q -s ntpdate /var/spool/cron/root; then
echo "adding crontab"
test -d /var/spool/cron || mkdir -p /var/spool/cron
echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
echo "30 * * * * /usr/sbin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
fi
fi
}