[systemd-devel] systemctl reboot get terminated by signal 15

Pengpeng Sun pengpengs at vmware.com
Thu Apr 29 16:55:50 UTC 2021


> > Hi Lennart,
> >
> > After modify journald.conf, got systemd log when the issue
> > reproduced. Please find it in attachment.
>
> Looking at the logs there seems to be a lot missing, in particular all
> the debug output of PID 1 is eventually going away.
>
> My educated guess: you are runnning "systemctl reboot" from user
> context? i.e. some script you run as part of your user sesion? If so,
> when the system goes down your user session of course will be
> terminated. Thus it's a race: either your session (and its associated
> services) are terminated via SIGTERM first, including the systemctl
> command you issued, or the systemctl is quicker and exits before it
> gets killed.
>

Here is where our code calls “/sbin/telinit 6” to reboot Linux.
https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/libDeployPkg/linuxDeployment.c#L1466
This code is executed when systemd vmtoolsd.service starts, attached the
vmtoolsd.service file.
Not seeing this issue before /sbin/telinit becomes a softlink to systemctl.

After I did a small change to let loop continue if the first /sbin/telinit fails,
then I can see only the first iteration /sbin/telinit got uncaught signal 15,
the second, the third iterations /sbin/telinit exit code is 0, no errors.
It seems our session is not terminated when SIGTERM received,
or systemctl is quicker and exits, but how could the latter iterations got
no errors.
> The net effect is the same: before we go down we need to terminate all
> processes, of course. And user processes are terminated before sytem
> processes, of course.



>
> Lennart
>
> --
> Lennart Poettering, Berlin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210429/e1d1c642/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vmtoolsd.service
Type: application/octet-stream
Size: 366 bytes
Desc: vmtoolsd.service
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210429/e1d1c642/attachment.obj>


More information about the systemd-devel mailing list