Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d8f87010
Commit
d8f87010
authored
Nov 30, 2017
by
antirez
Browse files
Be more verbose when DEBUG RESTART fails.
parent
2785d6ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
d8f87010
...
@@ -1549,16 +1549,29 @@ int restartServer(int flags, mstime_t delay) {
...
@@ -1549,16 +1549,29 @@ int restartServer(int flags, mstime_t delay) {
/* Check if we still have accesses to the executable that started this
/* Check if we still have accesses to the executable that started this
* server instance. */
* 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. */
/* Config rewriting. */
if
(
flags
&
RESTART_SERVER_CONFIG_REWRITE
&&
if
(
flags
&
RESTART_SERVER_CONFIG_REWRITE
&&
server
.
configfile
&&
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. */
/* Perform a proper shutdown. */
if
(
flags
&
RESTART_SERVER_GRACEFULLY
&&
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
/* Close all file descriptors, with the exception of stdin, stdout, strerr
* which are useful if we restart a Redis server which is not daemonized. */
* which are useful if we restart a Redis server which is not daemonized. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment