vsftpd: use <pkg>_INSTALL_INIT_SYSV and rename init script
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 30 Nov 2014 14:17:49 +0000 (15:17 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 1 Dec 2014 21:33:18 +0000 (22:33 +0100)
This commit changes the vsftpd package to use the
<pkg>_INSTALL_INIT_SYSV mechanism to install its init script, and
renames the init script in the Buildroot source tree to match how it's
named on the target.

Also, the init script is now installed unconditionally, as is done in
most packages.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/vsftpd/S70vsftpd [new file with mode: 0755]
package/vsftpd/vsftpd-init [deleted file]
package/vsftpd/vsftpd.mk

diff --git a/package/vsftpd/S70vsftpd b/package/vsftpd/S70vsftpd
new file mode 100755 (executable)
index 0000000..6048907
--- /dev/null
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+set -e
+
+DESC="vsftpd"
+NAME=vsftpd
+DAEMON=/usr/sbin/$NAME
+
+case "$1" in
+  start)
+       echo -n "Starting $DESC: "
+       start-stop-daemon -S -b -x $NAME
+       echo "OK"
+       ;;
+  stop)
+       echo -n "Stopping $DESC: "
+       start-stop-daemon -K -x $NAME
+       echo "OK"
+       ;;
+  restart|force-reload)
+       echo "Restarting $DESC: "
+       $0 stop
+       sleep 1
+       $0 start
+       echo ""
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+       exit 1
+       ;;
+esac
+
+exit 0
diff --git a/package/vsftpd/vsftpd-init b/package/vsftpd/vsftpd-init
deleted file mode 100755 (executable)
index 6048907..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /bin/sh
-
-set -e
-
-DESC="vsftpd"
-NAME=vsftpd
-DAEMON=/usr/sbin/$NAME
-
-case "$1" in
-  start)
-       echo -n "Starting $DESC: "
-       start-stop-daemon -S -b -x $NAME
-       echo "OK"
-       ;;
-  stop)
-       echo -n "Stopping $DESC: "
-       start-stop-daemon -K -x $NAME
-       echo "OK"
-       ;;
-  restart|force-reload)
-       echo "Restarting $DESC: "
-       $0 stop
-       sleep 1
-       $0 start
-       echo ""
-       ;;
-  *)
-       echo "Usage: $0 {start|stop|restart|force-reload}" >&2
-       exit 1
-       ;;
-esac
-
-exit 0
index cab5afb7322891b457148818b9fa6736e8630edb..1c468edd6daa648d64503b6c39003c98ac3b1ad9 100644 (file)
@@ -43,15 +43,16 @@ define VSFTPD_BUILD_CMDS
                LDFLAGS="$(TARGET_LDFLAGS)" LIBS="$(VSFTPD_LIBS)" -C $(@D)
 endef
 
+define VSFTPD_INSTALL_INIT_SYSV
+       $(INSTALL) -D -m 755 package/vsftpd/S70vsftpd $(TARGET_DIR)/etc/init.d/S70vsftpd
+endef
+
 define VSFTPD_INSTALL_TARGET_CMDS
        $(INSTALL) -D -m 755 $(@D)/vsftpd $(TARGET_DIR)/usr/sbin/vsftpd
        $(INSTALL) -D -m 644 $(@D)/vsftpd.8 \
                $(TARGET_DIR)/usr/share/man/man8/vsftpd.8
        $(INSTALL) -D -m 644 $(@D)/vsftpd.conf.5 \
                $(TARGET_DIR)/usr/share/man/man5/vsftpd.conf.5
-       test -f $(TARGET_DIR)/etc/init.d/S70vsftpd || \
-               $(INSTALL) -D -m 755 package/vsftpd/vsftpd-init \
-                       $(TARGET_DIR)/etc/init.d/S70vsftpd
        test -f $(TARGET_DIR)/etc/vsftpd.conf || \
                $(INSTALL) -D -m 644 $(@D)/vsftpd.conf \
                        $(TARGET_DIR)/etc/vsftpd.conf