diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-02-02 14:59:14 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-02-02 14:59:14 +0100 |
commit | 1d2e3c2ee2fb4c12ad25832b93ae9513d042717a (patch) | |
tree | ea7c2a7a03f39ae8dcb1de0d98d35aaa6c7b19d3 /conf.c | |
parent | 34b17d9b8901b72439167b99d780c481ce420e33 (diff) | |
parent | a49dcd5c3c6b79470ad71dc45ccf29f65ba2a7f9 (diff) |
Added RESTART command for easier upgrades without losing IPC connections.
(Obviously only works well for forking daemon mode.)
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -31,6 +31,7 @@ #include "conf.h" #include "ini.h" #include "url.h" +#include "ipc.h" #include "protocols/proxy.h" @@ -77,7 +78,7 @@ conf_t *conf_load( int argc, char *argv[] ) fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", CONF_FILE ); } - while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:h" ) ) >= 0 ) + while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:" ) ) >= 0 ) /* ^^^^ Just to make sure we skip this step from the REHASH handler. */ { if( opt == 'i' ) @@ -147,6 +148,14 @@ conf_t *conf_load( int argc, char *argv[] ) " -h Show this help page.\n" ); return( NULL ); } + else if( opt == 'R' ) + { + /* We can't load the statefile yet (and should make very sure we do this + only once), so set the filename here and load the state information + when initializing ForkDaemon. (This option only makes sense in that + mode anyway!) */ + ipc_master_set_statefile( optarg ); + } } if( conf->configdir[strlen(conf->configdir)-1] != '/' ) |