diff --git a/src/dnsmasq/dnsmasq.c b/src/dnsmasq/dnsmasq.c index cfcb38da..e051d3e2 100644 --- a/src/dnsmasq/dnsmasq.c +++ b/src/dnsmasq/dnsmasq.c @@ -1310,7 +1310,10 @@ int main_dnsmasq (int argc, char **argv) static void sig_handler(int sig) { - log_debug(DEBUG_ANY, "dnsmasq received signal %d", sig); + /**** Pi-hole modification ****/ + send_event(pipewrite, EVENT_SIGNAL, sig, NULL); + /******************************/ + if (pid == 0) { /* ignore anything other than TERM during startup @@ -1570,6 +1573,12 @@ static void async_event(int pipe, time_t now) my_syslog(LOG_WARNING, _("script process exited with status %d"), ev.data); break; + /**** Pi-hole modification ****/ + case EVENT_SIGNAL: + log_debug(DEBUG_ANY, "dnsmasq received signal %d", ev.data); + break; + /**************************** */ + case EVENT_EXEC_ERR: my_syslog(LOG_ERR, _("failed to execute %s: %s"), daemon->lease_change_command, strerror(ev.data)); diff --git a/src/dnsmasq/dnsmasq.h b/src/dnsmasq/dnsmasq.h index a16c83b4..ce8d1d09 100644 --- a/src/dnsmasq/dnsmasq.h +++ b/src/dnsmasq/dnsmasq.h @@ -200,6 +200,9 @@ struct event_desc { #define EVENT_SCRIPT_LOG 25 #define EVENT_TIME 26 +// Pi-hole +#define EVENT_SIGNAL 255 + /* Exit codes. */ #define EC_GOOD 0 #define EC_BADCONF 1