68 * SIGUSR1: reload the configuration files |
68 * SIGUSR1: reload the configuration files |
69 */ |
69 */ |
70 void sig_usr1_reload(int sig) { |
70 void sig_usr1_reload(int sig) { |
71 log_ereport(LOG_INFORM, "sig reload"); |
71 log_ereport(LOG_INFORM, "sig reload"); |
72 |
72 |
73 if(cfgmgr_load_config(NULL) != 0) { |
73 CfgManager mgr; |
74 log_ereport(LOG_FAILURE, "cannot reload config"); |
74 if(cfgmgr_load_config(&mgr) != 0) { |
75 } |
75 log_ereport(LOG_FAILURE, "cannot reload server.conf"); |
|
76 } else { |
|
77 if(cfgmgr_apply_config(&mgr)) { |
|
78 log_ereport(LOG_FAILURE, "cannot reload config"); |
|
79 } |
|
80 } |
|
81 |
76 // start newly created listeners |
82 // start newly created listeners |
77 start_all_listener(); |
83 start_all_listener(); |
78 |
84 |
79 signal(SIGUSR1, sig_usr1_reload); |
85 signal(SIGUSR1, sig_usr1_reload); |
80 } |
86 } |