Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
syslog-ng
syslog-ng-nohup-while-reload.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File syslog-ng-nohup-while-reload.diff of Package syslog-ng
--- src/main.c +++ src/main.c 2010/03/29 14:34:01 @@ -53,7 +53,7 @@ static char cfgfilename[128] = PATH_SYSL static char pidfilename[128] = PATH_PIDFILE; static gboolean do_fork = TRUE; -static gboolean sig_hup_received = FALSE; +static volatile sig_atomic_t sig_hup_received = 0; static gboolean sig_term_received = FALSE; static gboolean sig_child_received = FALSE; static gchar *chroot_dir = NULL; @@ -92,7 +92,7 @@ void usage(void) static void sig_hup_handler(int signo) { - sig_hup_received = TRUE; + sig_hup_received = 1; } static void @@ -168,10 +168,15 @@ main_loop_run(GlobalConfig **cfg) g_main_context_iteration(g_main_loop_get_context(main_loop), TRUE); if (sig_hup_received) { + sigset_t blockhup; + sigemptyset(&blockhup); + sigaddset (&blockhup, SIGHUP); + sigprocmask(SIG_BLOCK, &blockhup, NULL); + sig_hup_received = 0; + msg_notice("Configuration reload request received, reloading configuration", NULL); update_local_hostname(); (*cfg) = cfg_reload_config(cfgfilename, (*cfg), additional_sockets); - sig_hup_received = FALSE; if ((*cfg)->stats_freq > 0) { if (stats_timer_id != 0) @@ -179,6 +184,8 @@ main_loop_run(GlobalConfig **cfg) stats_timer_id = g_timeout_add((*cfg)->stats_freq * 1000, stats_timer, NULL); } stats_cleanup_orphans(); + + sigprocmask (SIG_UNBLOCK, &blockhup, NULL); } if (sig_term_received) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor