Ignore:
Timestamp:
2011-11-13T23:15:49+01:00 (4 years ago)
Author:
nico
Message:

packages/memcached: use new service functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/memcached/files/memcached.init

    r19913 r29061  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2010 OpenWrt.org 
     2# Copyright (C) 2010-2011 OpenWrt.org 
     3 
    34START=80 
    45 
    5 start_service () { 
    6     local section="$1" 
    7         config_get user "$section" user 
    8         config_get maxconn "$section" maxconn 
    9         config_get listen "$section" listen 
    10         config_get port "$section" port 
    11         config_get memory "$section" memory 
     6start_instance () { 
     7        local section="$1" 
    128 
    13         memcached_args="-d -u ${user:-nobody} -c ${maxconn:-1024} -l ${listen:-0.0.0.0} -p ${port:-11211} -U ${port:-11211} -m ${memory:-64}" 
    14         memcached $memcached_args >/dev/null 2>&1 
     9        config_get user "$section" user 
     10        config_get maxconn "$section" maxconn 
     11        config_get listen "$section" listen 
     12        config_get port "$section" port 
     13        config_get memory "$section" memory 
     14 
     15        service_start /usr/bin/memcached -d -u ${user:-nobody} \ 
     16                -c ${maxconn:-1024} -l ${listen:-0.0.0.0} \ 
     17                -p ${port:-11211} -U ${port:-11211} -m ${memory:-64} 
    1518} 
    1619 
    1720start() { 
    18     config_load "memcached" 
    19         config_foreach start_service memcached 
     21        config_load 'memcached' 
     22        config_foreach start_instance 'memcached' 
    2023} 
    2124 
    2225stop() { 
    23     killall memcached 
     26        service_stop /usr/bin/memcached 
    2427} 
Note: See TracChangeset for help on using the changeset viewer.