packages: ntp/ntpdate.upstart (NEW) - upstart config

glen glen at pld-linux.org
Thu Jan 27 22:56:14 CET 2011


Author: glen                         Date: Thu Jan 27 21:56:14 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- upstart config

---- Files affected:
packages/ntp:
   ntpdate.upstart (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/ntp/ntpdate.upstart
diff -u /dev/null packages/ntp/ntpdate.upstart:1.1
--- /dev/null	Thu Jan 27 22:56:14 2011
+++ packages/ntp/ntpdate.upstart	Thu Jan 27 22:56:09 2011
@@ -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
================================================================


More information about the pld-cvs-commit mailing list