Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've installed the memcached and configured /etc/init.d script.

/etc/init.d/memcached:

#!/bin/sh
#
# memcached    Startup script for memcached processes
#
# chkconfig: - 90 10
# description: Memcache provides fast memory based storage.
# processname: memcached


#[ -f memcached ] || echo 'erro' && exit 0

prog="memcached"

start() {
    echo -n $"Starting $prog "
    # Sessions cache.
    memcached start -d -m 1024 -p 11211 -u app2 -c 500 -P /vmapcom01/netsabe-ecommerce/shared/pids/memcached.pid

    RETVAL=$?
    echo
    return $RETVAL
}

stop() {
    if test "x`pidof memcached`" != x; then
        echo -n $"Stopping $prog "
        killall memcached
        echo
    fi
    RETVAL=$?
    return $RETVAL
}

case "$1" in
        start)
            start
            ;;

        stop)
            stop
            ;;

        restart)
            stop
            start
            ;;
        condrestart)
            if test "x`pidof memcached`" != x; then
                stop
                start
            fi
            ;;

        *)
            echo $"Usage: $0 {start|stop|restart|condrestart}"
            exit 1

esac

exit $RETVAL

runlevel configuration:

$ chkconfig --list | grep memcached
memcached       0:off   1:off   2:on    3:on    4:on    5:on    6:off

What is missing? Thank you!

share|improve this question
3  
What's wrong with the init script that came with the memcache package? Maybe the line that starts with memcached can be your problem if $PATH is not in the script. –  Frands Hansen May 28 '13 at 20:52
2  
Does the script work when you run it from the command line? What do your logs report? (and why set a variable in the script when you refer to the binary directly? –  symcbean May 28 '13 at 21:21
    
@FrandsHansen, someone edited script and now I have this. –  Rodrigo May 29 '13 at 1:13
    
@symcbean, the script works normally when run it from command line –  Rodrigo May 29 '13 at 1:14
    
This does not mean that the PATH from the command line is the same as the PATH when the machine boots. Make sure the execution path is the same. –  adamo Jun 25 '13 at 22:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.