dcron: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:02:32 +0000 (13:02 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 13 Jul 2015 16:18:38 +0000 (18:18 +0200)
Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/dcron/dcron.mk
package/dcron/dcron.service [new file with mode: 0644]

index fcb585d091361adfab42f15269866bf966fc028d..840471f5d2edce8c6db32601e7ae73cba76068fc 100644 (file)
@@ -33,4 +33,12 @@ define DCRON_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 0755 package/dcron/S90dcron $(TARGET_DIR)/etc/init.d/S90dcron
 endef
 
+define DCRON_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/dcron/dcron.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/dcron.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf /usr/lib/systemd/system/dcron.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dcron.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/dcron/dcron.service b/package/dcron/dcron.service
new file mode 100644 (file)
index 0000000..b9fa489
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Task scheduler daemon
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/crond -f -S
+Restart=always
+
+[Install]
+WantedBy=multi-user.target