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

Most of the time when I reboot my Ubunutu server, I get "Waiting for Redis to shutdown…" over and over and it never stops until I force reboot. What could cause this?

I have http://godrb.com/ monitoring that resque stays running, so it could be related to that.

share|improve this question
    
Is redis actually running as the PID that it has in the pidfile? Ubuntu will try to shut it down by killing it using something like kill $(cat /var/run/redis.pid) or something along those lines. If the pid file is incorrect, it will fail at killing redis. –  cjc Feb 10 '12 at 23:20
1  
Actually, if you're using god, you should probably, uh, kill god before anything else. –  cjc Feb 10 '12 at 23:41
    
Ok, thanks. So I need to manually kill god before each reboot? –  99miles Feb 13 '12 at 20:46
    
Try this: make sure god is stopped before the reboot, and see if the problem happens. –  cjc Feb 13 '12 at 21:19
    
The pid files (there are 2 resque processes running) are correct. I can kill the processes in the way you suggested. Now what can I do to not have to manually stop them before every reboot? –  99miles Feb 14 '12 at 4:28

4 Answers 4

Do you have Redis listening on an interface other than localhost or 127.0.0.1? If so, the stop command is never being sent to the right interface, as the official Redis init template fails to include the host address.

In the /etc/init.d/redis files I’ve worked with, I had to define REDISHOST=10.150.0.18 and then on line 30 (look for “shutdown”) add that host argument:

$CLIEXEC -h $REDISHOST -p $REDISPORT shutdown
share|improve this answer

If you were like me, you required a password (requirepass) in your redis.conf. the redis-cli command won't respond without the password now.

In the first few lines of your /etc/init.d/redis file look for CLIEXEC and change the default

CLIEEXEC=/usr/local/bin/redis-cli

to

CLIEEXEC="/usr/local/bin/redis-cli -a <password>"

Please take note of the quotes.

When I did this I didn't have to include the -h $REDISHOST parameters.

See here for the source of the idea: https://groups.google.com/forum/#!topic/redis-db/ITtbA1S-GGg

share|improve this answer

The conversation in this list can solve your problem:

Modify your init script to use '-a' (auth) in the redis-cli call.

CLIEXEC="/usr/local/bin/redis-cli -a password"

In other words, the problem is the fact that you have to enter the Redis password to stop the service. Modifying the /etc/init.d/redis_port script (or any other init script you might have) with -a password will solve it.

share|improve this answer

you can kill the redis process:

$ ps -ef|grep "redis"

# kill $(cat /var/run/redis.pid)
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.