#! /bin/sh # memcached: Memcached # # chkconfig: - 86 14 # description: memcached # processname: memcached # # Author: Gabriel Handford http://ducktyper.com # Source function library . /etc/rc.d/init.d/functions RETVAL=0 DESC="memcached" NAME="memcached" DAEMON=/usr/local/bin/memcached PIDFILE=<%= memcached_pid_path %> MEM=<%= memcached_memory %> PORT=<%= memcached_port %> # Have to be root in order to save in /var/run USER=root start() { echo -n $"Starting $DESC: " daemon $DAEMON -d -m $MEM -p $PORT -u $USER -P $PIDFILE RETVAL=$? echo return $RETVAL; } stop() { echo -n $"Stopping $DESC: " killproc -p $PIDFILE memcached RETVAL=$? echo return $RETVAL; } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 1 start ;; *) echo "Usage: $0 {start|stop|restart}" >&2 RETVAL=3; ;; esac exit $RETVAL;