[packages_10.03.2] pure-ftpd: merge r29054, r29290
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 5 Feb 2012 15:58:37 +0000 (15:58 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 5 Feb 2012 15:58:37 +0000 (15:58 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_10.03.2@30245 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/pure-ftpd/Makefile
net/pure-ftpd/files/pure-ftpd.init

index d4d39a3..07cf9e2 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pure-ftpd
 PKG_VERSION:=1.0.32
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://download.pureftpd.org/pub/pure-ftpd/releases
@@ -61,7 +61,8 @@ Package/pure-ftpd-tls/conffiles=$(Package/pure-ftpd/conffiles)
 
 CONFIGURE_ARGS += \
        --with-everything \
-       --with-virtualchroot
+       --with-virtualchroot \
+       --without-capabilities \
 
 ifeq ($(BUILD_VARIANT),tls)
 CONFIGURE_ARGS += \
index cb810b4..9c9d332 100644 (file)
@@ -1,10 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006-2011 OpenWrt.org
+
 START=50
 
-SSD=start-stop-daemon
-PIDF=/var/run/pure-ftpd.pid
-PROG=/usr/sbin/pure-ftpd
+# TODO: allow multiple instance to run with different pid-files
+
+# XXX: pure-ftpd changes it's name to 'pure-ftpd (SERVER) ...'
+SERVICE_MATCH_EXEC=
+SERVICE_MATCH_NAME=1
+SERVICE_USE_PID=1
 
 append_bool() {
        local section="$1"
@@ -24,10 +28,13 @@ append_string() {
        [ -n "$_val" ] && append args "$3 $_val"
 }
 
-start_service() {
+start_instance() {
        local section="$1"
-       args=""
 
+       config_get_bool enabled "$section" 'enabled' '1'
+       [ $enabled -gt 0 ] || return 1
+
+       args=""
        append_string "$section" trustedgid "-a"
        append_string "$section" syslogfacility "-f"
        append_string "$section" fortunesfile "-F"
@@ -87,23 +94,14 @@ start_service() {
        append_string "$section" port "-S"
        append_string "$section" authentication "-l"
 
-       config_get_bool "enabled" "$section" "enabled" '1'
-       [ "$enabled" -gt 0 ] && $SSD -S -p $PIDF -q -x $PROG -- -g $PIDF -B $args
-}
-
-stop_service() {
-       killall pure-ftpd 2>&1 > /dev/null
-
-       # FIXME: Fix Busybox start-stop-daemon to work with multiple PIDs
-       # $SSD -K -p $PIDF -q
+       service_start /usr/sbin/pure-ftpd -B $args
 }
 
 start() {
        config_load "pure-ftpd"
-       config_foreach start_service "pure-ftpd"
+       config_foreach start_instance "pure-ftpd"
 }
 
 stop() {
-       config_load "pure-ftpd"
-       config_foreach stop_service "pure-ftpd"
+       service_stop /usr/sbin/pure-ftpd
 }