package/vsftpd: add systemd unit
authorFrancois Perrad <fperrad@gmail.com>
Sat, 11 Jul 2020 13:58:43 +0000 (15:58 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 11 Jul 2020 21:51:25 +0000 (23:51 +0200)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/vsftpd/vsftpd.mk
package/vsftpd/vsftpd.service [new file with mode: 0644]

index 2f86d91ba2201145ffd40dfef98cab1d4e57c801..8a9aac2d29ec6ccc0dc1dda08783ff45d168c023 100644 (file)
@@ -47,6 +47,11 @@ define VSFTPD_USERS
        ftp -1 ftp -1 * /home/ftp - - Anonymous FTP User
 endef
 
+define VSFTPD_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0644 package/vsftpd/vsftpd.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/vsftpd.service
+endef
+
 define VSFTPD_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 755 package/vsftpd/S70vsftpd $(TARGET_DIR)/etc/init.d/S70vsftpd
 endef
diff --git a/package/vsftpd/vsftpd.service b/package/vsftpd/vsftpd.service
new file mode 100644 (file)
index 0000000..eba61ad
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=vsftpd FTP server
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target