diff -Nru ntp-4.2.6.p5+dfsg/debian/changelog ntp-4.2.6.p5+dfsg/debian/changelog --- ntp-4.2.6.p5+dfsg/debian/changelog 2013-04-03 09:51:30.000000000 +0200 +++ ntp-4.2.6.p5+dfsg/debian/changelog 2013-05-02 12:07:06.000000000 +0200 @@ -1,3 +1,16 @@ +ntp (1:4.2.6.p5+dfsg-2ubuntu2) saucy; urgency=low + + * debian/ntp.default: + + add two new options and description to all options: + - STEP_SYNC + - HW_SYNC + * debian/ntp.upstart: + + upstart job for ntp + * debian/ntp.init: + + utilize new STEP_SYNC and HW_SYNC in step_hw_sync() + + -- Ante Karamatic Thu, 02 May 2013 09:13:05 +0200 + ntp (1:4.2.6.p5+dfsg-2ubuntu1) raring; urgency=low * New upstream version, fixing build failure in raring. diff -Nru ntp-4.2.6.p5+dfsg/debian/ntp.default ntp-4.2.6.p5+dfsg/debian/ntp.default --- ntp-4.2.6.p5+dfsg/debian/ntp.default 2006-07-29 20:02:57.000000000 +0200 +++ ntp-4.2.6.p5+dfsg/debian/ntp.default 2013-05-02 12:07:06.000000000 +0200 @@ -1 +1,11 @@ +# Options for ntp daemon NTPD_OPTS='-g' + +# This option starts one off sync that shifts the clock +# to correct time. It's pretty much the same thing +# ntpdate does. +STEP_SYNC='no' + +# This option syncs OS time to hardware clock. If STEP_SYNC +# is not enabled, this function doesn't do anything. +HW_SYNC='no' diff -Nru ntp-4.2.6.p5+dfsg/debian/ntp.init ntp-4.2.6.p5+dfsg/debian/ntp.init --- ntp-4.2.6.p5+dfsg/debian/ntp.init 2013-04-03 09:38:53.000000000 +0200 +++ ntp-4.2.6.p5+dfsg/debian/ntp.init 2013-05-02 12:07:06.000000000 +0200 @@ -44,6 +44,15 @@ fi } +step_hw_sync() { + if [ "x$STEP_SYNC" = "xyes" ]; then + $DAEMON $NTPD_OPTS -gq -u $UGID + if ["x$HW_SYNC" = "xyes" ]; then + /sbin/hwclock -w + fi + fi +} + RUNASUSER=ntp UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true if test "$(uname -s)" = "Linux"; then @@ -58,6 +67,7 @@ exit 1 fi lock_ntpdate + step_hw_sync start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS status=$? unlock_ntpdate diff -Nru ntp-4.2.6.p5+dfsg/debian/ntp.upstart ntp-4.2.6.p5+dfsg/debian/ntp.upstart --- ntp-4.2.6.p5+dfsg/debian/ntp.upstart 1970-01-01 01:00:00.000000000 +0100 +++ ntp-4.2.6.p5+dfsg/debian/ntp.upstart 2013-05-02 12:12:29.000000000 +0200 @@ -0,0 +1,52 @@ +description "ntp daemon" +author "Ante Karamatić " + +start on runlevel [2345] or net-device-up IFACE!=lo +stop on runlevel [06] + +respawn + +env LOCKFILE=/var/lock/ntpdate +env RUNASUSER=ntp + +pre-start script + if [ -x /usr/bin/lockfile-create ]; then + lockfile-create $LOCKFILE + lockfile-touch $LOCKFILE & + echo PID="$!" > /var/run/ntp.vars + fi +end script + +script + [ -r /etc/default/ntp ] && . /etc/default/ntp + + UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true + if [ -z "$UGID" ]; then + exit 1 + fi + if test "$(uname -s)" = "Linux"; then + NTPD_OPTS="$NTPD_OPTS -u $UGID" + fi + + if [ -e /var/lib/ntp/ntp.conf.dhcp ]; then + NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp" + fi + + if [ "x$STEP_SYNC" = "xyes" ]; then + /usr/sbin/ntpd $NTPD_OPTS -gq -n + if [ "x$HW_SYNC" = "xyes" ]; then + hwclock -w + fi + fi + + exec /usr/sbin/ntpd $NTPD_OPTS -n +end script + +post-start script + if [ -x /usr/bin/lockfile-create ] ; then + . /var/run/ntp.vars + kill $PID + lockfile-remove $LOCKFILE + rm /var/run/ntp.vars + fi +end script