redis-cli shutdown on non-localhost, is this a bug or an future?

21 views
Skip to first unread message

Dimitri Pekarovsky

unread,
Jan 7, 2017, 9:34:44 AM1/7/17
to Redis DB
Hello all

When I want to stop a redis server that listens on non-localhost, is there any automatic way to stop server?
So, for example, I have a server started at some gray address, like 192.168.1.2. Today. Not tomorrow.
And I need to write that address in redis.conf and in redis.service for using with
redis-cli -h HOST shutdown
Then tomorrow I will change his listen address to 10.10.13.25 because all those are virtual boxes for testing some apps.
And every time I change that in redis.conf, I need to change that in startup/shutdown script also.
Why redis-cli will not recognize host address from /etc/redis.conf ?
Am I missed something?

//Dimitri

Jan-Erik Rediger

unread,
Jan 7, 2017, 9:52:17 AM1/7/17
to redi...@googlegroups.com
Because redis-cli does not assume anything about your environment.
Redis itself does not define a default path for its configuration, so
redis-cli cannot either.
Plus, redis-cli can't even assume it is run on the same host as the
server.

You have two possibilities:
1. Read your configuration in the service file to extract the IP
2. Just kill the server, it will cleanly shutdown (at least if you send
it a SIGTERM).
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages