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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
PATH=/sbin:/bin:/usr/bin 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 if test -f /etc/default/ntpdate ; then
. /etc/default/ntpdate . /etc/default/ntpdate
@ -35,7 +35,7 @@ if [ -x /usr/bin/lockfile-create ]; then
LOCKTOUCHPID="$!" LOCKTOUCHPID="$!"
fi 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 if [ "$UPDATE_HWCLOCK" = "yes" ]; then
hwclock --systohc || : hwclock --systohc || :
fi fi

View File

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

View File

@ -5,7 +5,6 @@ or satellite receiver or modem."
HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome" HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome"
SECTION = "console/network" SECTION = "console/network"
LICENSE = "ntp" LICENSE = "ntp"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670"
RSUGGESTS_${PN} = "iana-etc" RSUGGESTS_${PN} = "iana-etc"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \ 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 require ntp.inc
PR = "r3" PR = "r5"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \ 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 \ 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://ntpdate.service \
file://ntpd.service \ file://ntpd.service \
" "
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f41fedb22dffefcbfafecc85b0f79cfa"
SRC_URI[md5sum] = "65d8cdfae4722226fbe29863477641ed" SRC_URI[md5sum] = "65d8cdfae4722226fbe29863477641ed"
SRC_URI[sha256sum] = "948274b88f1ed002d867ced6aaefdfd0999668b11285ac2b3a67ff2629d59d88" SRC_URI[sha256sum] = "948274b88f1ed002d867ced6aaefdfd0999668b11285ac2b3a67ff2629d59d88"
EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd --with-yielding-select=yes" EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd --with-yielding-select=yes"
PACKAGES += "${PN}-perl"
do_install_append() { do_install_append() {
install -d ${D}/${sysconfdir}/init.d install -d ${D}/${sysconfdir}/init.d
install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir} 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/ ln -sf ../ntpd.service ${D}${systemd_unitdir}/system/multi-user.target.wants/
} }
FILES_${PN}-bin = "${bindir}/ntp-wait \ FILES_${PN}-bin = "${sbindir}/ntp-wait \
${bindir}/ntpdc \ ${sbindir}/ntpdc \
${bindir}/ntpq \ ${sbindir}/ntpq \
${bindir}/ntptime \ ${bindir}/ntptime \
${bindir}/ntptrace" ${sbindir}/ntptrace"
FILES_${PN} = "${bindir}/ntpd \ FILES_${PN} = "${sbindir}/ntpd \
${libdir}/ntp \
${sysconfdir}/ntp.conf \ ${sysconfdir}/ntp.conf \
${sysconfdir}/init.d/ntpd \ ${sysconfdir}/init.d/ntpd \
${systemd_unitdir}/system/ntpd.service \ ${systemd_unitdir}/system/ntpd.service \
${systemd_unitdir}/system/multi-user.target.wants/ntpd.service" ${systemd_unitdir}/system/multi-user.target.wants/ntpd.service"
FILES_${PN}-tickadj = "${bindir}/tickadj" FILES_${PN}-tickadj = "${sbindir}/tickadj"
FILES_ntp-utils = "${bindir}/*" FILES_ntp-perl = "${prefix}/share/ntp/lib/NTP/Util.pm \
FILES_ntpdate = "${bindir}/ntpdate \ ${bindir}/ntpsweep ${bindir}/ntptrace \
${sbindir}/calc_tickadj ${sbindir}/ntp-wait"
FILES_ntpdate = "${sbindir}/ntpdate \
${sysconfdir}/network/if-up.d/ntpdate \ ${sysconfdir}/network/if-up.d/ntpdate \
${systemd_unitdir}/system/ntpdate.service \ ${systemd_unitdir}/system/ntpdate.service \
${systemd_unitdir}/system/multi-user.target.wants/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 # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
# with wonky clocks (e.g. OpenSlug) # with wonky clocks (e.g. OpenSlug)
@ -61,7 +70,7 @@ else
if ! grep -q -s ntpdate /var/spool/cron/root; then if ! grep -q -s ntpdate /var/spool/cron/root; then
echo "adding crontab" echo "adding crontab"
test -d /var/spool/cron || mkdir -p /var/spool/cron 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
fi fi
} }