add "dumpcore" config to avoid setting up the segv handler if you don't want it.

This commit is contained in:
Robey Pointer
2010-08-19 16:35:59 -07:00
parent 0bccb9f08c
commit 79fda18d2b
3 changed files with 10 additions and 2 deletions
+4
View File
@@ -141,6 +141,10 @@ void loadServerConfig(char *filename) {
if ((server.activerehashing = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
} else if (!strcasecmp(argv[0],"dumpcore") && argc == 2) {
if ((server.dumpcore = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
} else if (!strcasecmp(argv[0],"daemonize") && argc == 2) {
if ((server.daemonize = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
+5 -2
View File
@@ -501,7 +501,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
* This is not precise but we don't need at all precision, but just
* something statistically reasonable.
*/
server.lruclock = (time(NULL)/60)&((1<<21)-1);
server.lruclock = (server.unixtime/60)&((1<<21)-1);
/* We received a SIGTERM, shutting down here in a safe way, as it is
* not ok doing so inside the signal handler. */
@@ -729,6 +729,7 @@ void initServerConfig() {
server.requirepass = NULL;
server.rdbcompression = 1;
server.activerehashing = 1;
server.dumpcore = 0;
server.maxclients = 0;
server.blpop_blocked_clients = 0;
server.maxmemory = 0;
@@ -770,7 +771,9 @@ void initServer() {
signal(SIGHUP, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
setupSigSegvAction();
if (!server.dumpcore) {
setupSigSegvAction();
}
server.mainthread = pthread_self();
server.devnull = fopen("/dev/null","w");
+1
View File
@@ -371,6 +371,7 @@ struct redisServer {
char *requirepass;
int rdbcompression;
int activerehashing;
int dumpcore;
/* Replication related */
int isslave;
char *masterauth;