packages/memcached: use new service functions
authorNicolas Thill <nico@openwrt.org>
Sun, 13 Nov 2011 22:15:49 +0000 (22:15 +0000)
committerNicolas Thill <nico@openwrt.org>
Sun, 13 Nov 2011 22:15:49 +0000 (22:15 +0000)
SVN-Revision: 29061

net/memcached/Makefile
net/memcached/files/memcached.init

index 617ede5a6d585651271c10fbf863b75928549d4c..acc29409edaf0c01f44c9636df38dbac51884af7 100644 (file)
@@ -1,14 +1,16 @@
 #
+# Copyright (C) 2009-2011 OpenWrt.org
 # Copyright (C) 2009-2010 Thomas Heil <heil@terminal-consulting.de>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
+#
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=memcached
 PKG_VERSION:=1.2.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://memcached.googlecode.com/files
index 1ba27d60d54e42cd2fc4313c09d6f6d850ea6356..063bf64725ac9dad91f1cf250e76e82a1072fb13 100644 (file)
@@ -1,24 +1,27 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2010 OpenWrt.org
+# Copyright (C) 2010-2011 OpenWrt.org
+
 START=80
 
-start_service () {
-    local section="$1"
-        config_get user "$section" user
-        config_get maxconn "$section" maxconn
-        config_get listen "$section" listen
-        config_get port "$section" port
-        config_get memory "$section" memory
+start_instance () {
+       local section="$1"
+
+       config_get user "$section" user
+       config_get maxconn "$section" maxconn
+       config_get listen "$section" listen
+       config_get port "$section" port
+       config_get memory "$section" memory
 
-        memcached_args="-d -u ${user:-nobody} -c ${maxconn:-1024} -l ${listen:-0.0.0.0} -p ${port:-11211} -U ${port:-11211} -m ${memory:-64}"
-        memcached $memcached_args >/dev/null 2>&1
+       service_start /usr/bin/memcached -d -u ${user:-nobody} \
+               -c ${maxconn:-1024} -l ${listen:-0.0.0.0} \
+               -p ${port:-11211} -U ${port:-11211} -m ${memory:-64}
 }
 
 start() {
-    config_load "memcached"
-        config_foreach start_service memcached
+       config_load 'memcached'
+       config_foreach start_instance 'memcached'
 }
 
 stop() {
-    killall memcached
+       service_stop /usr/bin/memcached
 }