core/manager: print info about interesting signals

Information about signals which are not routinely received by systemd
are printed at info level. This should make it easier to see what is
happening in the system.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-12-27 22:12:38 -05:00
parent 41aef6fc74
commit a9244623f7

View file

@ -1463,16 +1463,22 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
}
if (sfsi.ssi_pid > 0) {
char *p = NULL;
_cleanup_free_ char *p = NULL;
get_process_comm(sfsi.ssi_pid, &p);
log_debug("Received SIG%s from PID %lu (%s).",
signal_to_string(sfsi.ssi_signo),
(unsigned long) sfsi.ssi_pid, strna(p));
free(p);
log_full(sfsi.ssi_signo == SIGCHLD ||
(sfsi.ssi_signo == SIGTERM && m->running_as == SYSTEMD_USER)
? LOG_DEBUG : LOG_INFO,
"Received SIG%s from PID %lu (%s).",
signal_to_string(sfsi.ssi_signo),
(unsigned long) sfsi.ssi_pid, strna(p));
} else
log_debug("Received SIG%s.", signal_to_string(sfsi.ssi_signo));
log_full(sfsi.ssi_signo == SIGCHLD ||
(sfsi.ssi_signo == SIGTERM && m->running_as == SYSTEMD_USER)
? LOG_DEBUG : LOG_INFO,
"Received SIG%s.",
signal_to_string(sfsi.ssi_signo));
switch (sfsi.ssi_signo) {