Add systemd service to manager ConnMan NTP
authorZhang zhengguang <zhengguang.zhang@intel.com>
Fri, 4 Jul 2014 06:12:08 +0000 (14:12 +0800)
committerZhang zhengguang <zhengguang.zhang@intel.com>
Thu, 17 Jul 2014 05:01:05 +0000 (13:01 +0800)
packaging/40-connman-ntp.list [new file with mode: 0644]
packaging/connman-ntp.service [new file with mode: 0644]

diff --git a/packaging/40-connman-ntp.list b/packaging/40-connman-ntp.list
new file mode 100644 (file)
index 0000000..9b84282
--- /dev/null
@@ -0,0 +1 @@
+connman-ntp.service
diff --git a/packaging/connman-ntp.service b/packaging/connman-ntp.service
new file mode 100644 (file)
index 0000000..6ca46e2
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Connman NTP service
+Requires=connman.service
+After=connman.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/bash -c "dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Clock.SetProperty string:'TimeUpdates' variant:string:'auto'"
+ExecStop=/bin/bash -c "dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Clock.SetProperty string:'TimeUpdates' variant:string:'manual'"
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target