[systemd-devel] systemctl reboot get terminated by signal 15
Lennart Poettering
lennart at poettering.net
Mon Apr 19 14:37:36 UTC 2021
On Mo, 19.04.21 14:29, Pengpeng Sun (pengpengs at vmware.com) wrote:
> Hi there,
>
> Our program executes 'systemctl reboot' in a child process to reboot
> Linux right after its booted, Sometimes there is no error, but
> sometimes the child process terminated due to received uncaught
> signal 15, then no reboot happened. WIFSIGNALED evaluated a non-zero
> value, WTERMSIG evaluated 15. Don't understand why the uncaught
> signal 15 happened here, could you please shed light on this,
> Thanks.
15 is SIGTERM, i.e. the signal sent when a process is politely asked
to shut down. Something is terminating your process.
It could be systemd, could be something else.
To track down what it is, maybe turn on debug logging in systemd, maybe
you find the explanation there. i.e. "systemd-analyze log-level debug"
and then reproduce the issue.
ALternatively, install a signal handler for SIGTERM via sigaction, and
look into the .si_pid field of the siginfo_t you can receive in the
handler. It tells you which processes sent the SIGTERM.
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list