diff --git a/extra/ntp/PKGBUILD b/extra/ntp/PKGBUILD index dd7707d..b392044 100644 --- a/extra/ntp/PKGBUILD +++ b/extra/ntp/PKGBUILD @@ -5,7 +5,7 @@ pkgname=ntp pkgver=4.2.6.p4 _realver=4.2.6p4 -pkgrel=2 +pkgrel=3 pkgdesc='Network Time Protocol reference implementation' url='http://www.ntp.org/' license=('custom') @@ -18,11 +18,6 @@ source=("http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${_realver}.tar.gz" 'ntpdate' 'ntp.conf' 'ntpd.conf') -sha1sums=('b53c4565c5d1c37494584d4fb826f82ffea285cf' - '97b41b8bc34f259f4e525ab2e58707c9724e72e2' - '63572457586379aa6bf75b6e899e71d651e643f4' - 'f6fa4838a33a3abcdd168a37b3f4a2dddd60472e' - '6cfcb7bbd34499b30e31dffca2f3e1a036010271') install=install @@ -59,3 +54,8 @@ package() { touch "${pkgdir}"/var/lib/ntp/.placeholder } +md5sums=('1447121a07b49361677ffda4f6e29527' + 'dfefe71a1f79777f3c14c94dbc514044' + 'ab55ac8d8d7d0eefa3c3bec2ec98a1f4' + '77398dfce116bd29aa04c4a80ac634dc' + '58997d6cf4846d80e35a01b855376a33') diff --git a/extra/ntp/install b/extra/ntp/install index ad9a39d..a1e4b37 100644 --- a/extra/ntp/install +++ b/extra/ntp/install @@ -1,4 +1,13 @@ post_upgrade() { + if [[ $(vercmp $2 4.2.6.p4) -le 0 ]]; then + cat < The pid file /var/run/ntpd.pid has been renamed to /run/ntpd.pid +==> /etc/rc.d/ntpd will be unable to stop the ntpd process running at this time. +==> Please kill ntpd manually if you wish to restart this script. + +EOF + fi if [[ $(vercmp $2 4.2.6.p3) -le 0 ]]; then cat < /dev/null) +pidfile=/run/ntpd.pid +if [[ -r $pidfile ]]; then + read -r PID < "$pidfile" + if [[ $PID && ! -d /proc/$PID ]]; then + # stale pidfile + unset PID + rm -f "$pidfile" + fi +fi case "$1" in start) stat_busy "Starting NTP Daemon" - [ ! -d /var/run/ntpd ] && install -d /var/run/ntpd &>/dev/null - if [ -z "$PID" ]; then - /usr/bin/ntpd $NTPD_ARGS -p /var/run/ntpd/ntpd.pid &>/dev/null - if [ $? -gt 0 ]; then - stat_fail - exit 1 - else - add_daemon ntpd - stat_done - fi + if [[ -z $PID ]] && /usr/bin/ntpd $NTPD_ARGS -p "$pidfile" &>/dev/null; then + add_daemon ntpd + stat_done else stat_fail exit 1 @@ -27,16 +27,9 @@ case "$1" in ;; stop) stat_busy "Stopping NTP Daemon" - if [ -n "$PID" ]; then - kill $PID &> /dev/null - if [ $? -gt 0 ]; then - stat_fail - exit 1 - else - rm $PIDFILE &>/dev/null - rm_daemon ntpd - stat_done - fi + if [[ $PID ]] && kill $PID &>/dev/null; then + rm_daemon ntpd + stat_done else stat_fail exit 1