<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-CN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<div>
<p class="MsoNormal">> > Hi Lennart,<o:p></o:p></p>
<p class="MsoNormal">> ><o:p></o:p></p>
<p class="MsoNormal">> > After modify journald.conf, got systemd log when the issue<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">> > </span>reproduced. Please find it in attachment.<o:p></o:p></p>
<p class="MsoNormal">> <o:p></o:p></p>
<p class="MsoNormal">> Looking at the logs there seems to be a lot missing, in particular all<o:p></o:p></p>
<p class="MsoNormal">> the debug output of PID 1 is eventually going away.<o:p></o:p></p>
<p class="MsoNormal">> <o:p></o:p></p>
<p class="MsoNormal">> My educated guess: you are runnning "systemctl reboot" from user<o:p></o:p></p>
<p class="MsoNormal">> context? i.e. some script you run as part of your user sesion? If so,<o:p></o:p></p>
<p class="MsoNormal">> when the system goes down your user session of course will be<o:p></o:p></p>
<p class="MsoNormal">> terminated. Thus it's a race: either your session (and its associated<o:p></o:p></p>
<p class="MsoNormal">> services) are terminated via SIGTERM first, including the systemctl<o:p></o:p></p>
<p class="MsoNormal">> command you issued, or the systemctl is quicker and exits before it<o:p></o:p></p>
<p class="MsoNormal">> gets killed.<o:p></o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Here is where our code calls “/sbin/telinit 6” to reboot Linux.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><a href="https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/libDeployPkg/linuxDeployment.c#L1466">https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/libDeployPkg/linuxDeployment.c#L1466</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">This code is executed when systemd vmtoolsd.service starts, attached the<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">vmtoolsd.service file.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Not seeing this issue before /sbin/telinit becomes a softlink to systemctl.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">After I did a small change to let loop continue if the first /sbin/telinit fails,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">then I can see only the first iteration /sbin/telinit got uncaught signal 15,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">the second, the third iterations /sbin/telinit exit code is 0, no errors.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It seems our session is not terminated when SIGTERM received,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">or systemctl is quicker and exits, but how could the latter iterations got<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">no errors.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">> The net effect is the same: before we go down we need to terminate all<o:p></o:p></p>
<p class="MsoNormal">> processes, of course. And user processes are terminated before sytem<o:p></o:p></p>
<p class="MsoNormal">> processes, of course.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> <o:p></o:p></p>
<p class="MsoNormal">> Lennart<o:p></o:p></p>
<p class="MsoNormal">> <o:p></o:p></p>
<p class="MsoNormal">> --<o:p></o:p></p>
<p class="MsoNormal">> Lennart Poettering, Berlin<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>