You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
585 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2010-2011 OpenWrt.org
  3. START=80
  4. start_instance () {
  5. local section="$1"
  6. config_get user "$section" user
  7. config_get maxconn "$section" maxconn
  8. config_get listen "$section" listen
  9. config_get port "$section" port
  10. config_get memory "$section" memory
  11. service_start /usr/bin/memcached -d -u ${user:-memcached} \
  12. -c ${maxconn:-1024} -l ${listen:-0.0.0.0} \
  13. -p ${port:-11211} -U ${port:-11211} -m ${memory:-64}
  14. }
  15. start() {
  16. config_load 'memcached'
  17. config_foreach start_instance 'memcached'
  18. }
  19. stop() {
  20. service_stop /usr/bin/memcached
  21. }