Add systemd service file
authorSteve McIntyre <steve@einval.com>
Fri, 5 Sep 2014 16:15:10 +0000 (17:15 +0100)
committerSteve McIntyre <steve@einval.com>
Fri, 5 Sep 2014 16:15:10 +0000 (17:15 +0100)
use dh-systemd to install appropriately. Thanks to Alexandre Detiste
for the patch. Closes: #760446

debian/changelog
debian/control
debian/fake-hwclock.service [new file with mode: 0644]
debian/rules

index 8e3f218..103ad9e 100644 (file)
@@ -2,6 +2,9 @@ fake-hwclock (0.6) unstable; urgency=medium
 
   * Update Standards-Version to 3.9.5 (no changes needed)
   * Include /lib/lsb/init-functions in the init script
+  * Add systemd service file and use dh-systemd to install
+    appropriately. Thanks to Alexandre Detiste for the patch.
+    Closes: #760446
 
  -- Steve McIntyre <93sam@debian.org>  Fri, 05 Sep 2014 16:56:21 +0100
 
index b4680c2..f6771fc 100644 (file)
@@ -2,7 +2,7 @@ Source: fake-hwclock
 Section: admin
 Priority: extra
 Maintainer: Steve McIntyre <93sam@debian.org>
-Build-Depends: debhelper (>= 8)
+Build-Depends: debhelper (>= 8), dh-systemd (>= 1.5)
 Standards-Version: 3.9.5
 Vcs-Browser: http://git.einval.com/cgi-bin/gitweb.cgi?p=fake-hwclock.git
 Vcs-Git: http://git.einval.com/git/fake-hwclock.git
diff --git a/debian/fake-hwclock.service b/debian/fake-hwclock.service
new file mode 100644 (file)
index 0000000..af6fc04
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Restore / save the current clock
+Before=systemd-fsck-root.service
+
+[Service]
+EnvironementFile=-/etc/default/fake-hwclock
+ExecStart=fake-hwclock load $FORCE
+ExecStop=fake-hwclock save
+
+[Install]
+WantedBy=multi-user.target
index f3b8e38..e89893d 100755 (executable)
@@ -28,7 +28,9 @@ binary-indep: install
        dh_installchangelogs
        dh_installdocs
        dh_installcron
+       dh_systemd_enable
        dh_installinit --no-start -- start 02 S . stop 02 0 1 6 .
+       dh_systemd_start
        dh_installman
        dh_compress
        dh_fixperms