2010-02-28 12:26:53 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2010-02-28 17:19:34 +00:00
|
|
|
# Copyright (C) 2010 OpenWrt.org
|
2010-02-28 12:26:53 +00:00
|
|
|
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
|
|
|
|
|
2010-02-28 17:19:34 +00:00
|
|
|
memcached_args="-d -u ${user:-nobody} -c ${maxconn:-1024} -l ${listen:-0.0.0.0} -p ${port:-11211} -U ${port:-11211} -m ${memory:-64}"
|
2010-02-28 12:26:53 +00:00
|
|
|
memcached $memcached_args >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
config_load "memcached"
|
|
|
|
config_foreach start_service memcached
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
killall memcached
|
|
|
|
}
|