proftpd: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:06:15 +0000 (13:06 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 09:56:21 +0000 (11:56 +0200)
[Thomas: change to use a relative symlink, and fix a minor typo in the
service file in the service description.]

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/proftpd/proftpd.mk
package/proftpd/proftpd.service [new file with mode: 0644]

index 023b4ddc9fcab7b5d1907e2977a92f4bb4b7047f..dec243d4564a680828d46fedb07f0c714a5b23bd 100644 (file)
@@ -55,4 +55,12 @@ define PROFTPD_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 0755 package/proftpd/S50proftpd $(TARGET_DIR)/etc/init.d/S50proftpd
 endef
 
+define PROFTPD_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/proftpd/proftpd.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/proftpd.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/proftpd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/proftpd.service
+endef
+
 $(eval $(autotools-package))
diff --git a/package/proftpd/proftpd.service b/package/proftpd/proftpd.service
new file mode 100644 (file)
index 0000000..1c730e5
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=FTP server
+After=syslog.target network.target
+
+[Service]
+ExecStart=/usr/sbin/proftpd -n -q
+Restart=always
+
+[Install]
+WantedBy=multi-user.target