5 .
/etc
/conf.d
/memcached-repcached
7 PIDFILE
='/var/run/memcached-repcached.pid'
11 pid
=$
(cat $PIDFILE 2>/dev
/null
)
12 # if the process is no longer valid, don't return it
13 if [ -n "$pid" ]; then
14 if ! ps
-p $pid >/dev
/null
; then
26 stat_busy
"Starting memcached-repcached"
27 # memcached is retarded and doesn't write to the pidfile
28 # before it drops permissions
29 if [ -n "$PID" ]; then
31 elif [ -z "$MEMCACHED_USER" ]; then
32 echo "MEMCACHED_USER must be defined in /etc/conf.d/memcached-repcached"
35 touch $PIDFILE && chown
$MEMCACHED_USER $PIDFILE
36 /usr
/bin
/memcached-repcached
-d -P $PIDFILE -u $MEMCACHED_USER $MEMCACHED_ARGS
40 add_daemon memcached-repcached
46 stat_busy
"Stopping memcached-repcached"
47 [ ! -z "$PID" ] && kill $PID &> /dev
/null
52 rm_daemon memcached-repcached
62 echo "usage: $0 {start|stop|restart}"