From ac5d49d5f808ff60a916e94098dc41ddd3c2819b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 27 Jan 2011 21:56:09 +0000 Subject: [PATCH] - upstart config Changed files: ntpdate.upstart -> 1.1 --- ntpdate.upstart | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ntpdate.upstart diff --git a/ntpdate.upstart b/ntpdate.upstart new file mode 100644 index 0000000..dc72c17 --- /dev/null +++ b/ntpdate.upstart @@ -0,0 +1,26 @@ +description "Synchronizes time with ntpdate (NTP client)" + +# TODO: act on "have default gateway" +# start on net-device-added INTERFACE!=lo +# TODO: run before ntpd + +start on pld.network-started +stop on pld.shutdown-started + +env NTPDATE_USER="ntp" + +task + +# mark that ntpdate fail is ok (task marked as done and hwclock skipped) +normal exit 0 1 + +script + # Source old-style ntp service configuration + [ -f /etc/sysconfig/ntpdate ] && . /etc/sysconfig/ntpdate + + /usr/sbin/ntpdate -s ${NTPDATE_USER:+-U $NTPDATE_USER} $NTPDATE_OPTIONS $NTPDATE_SERVERS + + if [ "$SYNC_HWCLOCK" = "yes" ]; then + /sbin/hwclock --systohc + fi +end script -- 2.44.0