Commit 5efee4f0 authored by antirez's avatar antirez
Browse files

Sentinel: better specify startup errors due to config file.

Now it logs the file name if it is not accessible. Also there is a
different error for the missing config file case, and for the non
writable file case.
parent 1d4d9e7b
...@@ -417,8 +417,13 @@ void initSentinel(void) { ...@@ -417,8 +417,13 @@ void initSentinel(void) {
void sentinelIsRunning(void) { void sentinelIsRunning(void) {
redisLog(REDIS_WARNING,"Sentinel runid is %s", server.runid); redisLog(REDIS_WARNING,"Sentinel runid is %s", server.runid);
if (server.configfile == NULL || access(server.configfile,W_OK) == -1) { if (server.configfile == NULL) {
redisLog(REDIS_WARNING,"Sentinel started without a config file, or config file not writable. Exiting..."); redisLog(REDIS_WARNING,
"Sentinel started without a config file. Exiting...");
} else if (access(server.configfile,W_OK) == -1) {
redisLog(REDIS_WARNING,
"Sentinel config file %s is not writable: %s. Exiting...",
server.configfile,strerror(errno));
exit(1); exit(1);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment