summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-11-30 18:08:21 +0100
committerantirez <antirez@gmail.com>2017-11-30 18:40:17 +0100
commitb7c7edf912fcd4a02b803c5bf84294e707232d77 (patch)
tree4bb7ee5e91b58f719c68831381dc15c6769ce6b0
parentcbb6f457845755e4d037085fb9c9e3982cb60f88 (diff)
downloadredis-b7c7edf912fcd4a02b803c5bf84294e707232d77.tar.gz
Be more verbose when DEBUG RESTART fails.
-rw-r--r--src/server.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c
index 6bc8bc66f..e56b542a5 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1549,16 +1549,29 @@ int restartServer(int flags, mstime_t delay) {
/* Check if we still have accesses to the executable that started this
* server instance. */
- if (access(server.executable,X_OK) == -1) return C_ERR;
+ if (access(server.executable,X_OK) == -1) {
+ serverLog(LL_WARNING,"Can't restart: this process has no "
+ "permissions to execute %s", server.executable);
+ return C_ERR;
+ }
/* Config rewriting. */
if (flags & RESTART_SERVER_CONFIG_REWRITE &&
server.configfile &&
- rewriteConfig(server.configfile) == -1) return C_ERR;
+ rewriteConfig(server.configfile) == -1)
+ {
+ serverLog(LL_WARNING,"Can't restart: configuration rewrite process "
+ "failed");
+ return C_ERR;
+ }
/* Perform a proper shutdown. */
if (flags & RESTART_SERVER_GRACEFULLY &&
- prepareForShutdown(SHUTDOWN_NOFLAGS) != C_OK) return C_ERR;
+ prepareForShutdown(SHUTDOWN_NOFLAGS) != C_OK)
+ {
+ serverLog(LL_WARNING,"Can't restart: error preparing for shutdown");
+ return C_ERR;
+ }
/* Close all file descriptors, with the exception of stdin, stdout, strerr
* which are useful if we restart a Redis server which is not daemonized. */