<div dir="ltr"><div>In that case, why not use the timeout stuff from the services?</div><div><br></div><div>You could probably override the service to set a timeout for its running with</div><div>[Unit]<br>JobRunningTimeoutSec=300</div><div>JobTimeoutAction=reboot-force</div><div><br></div><div>So after starting you get up to 5 minutes of it running and then it should reboot. Probably the JobTimeoutAction is not needed as I'm sure it will reboot if the emergency.service fails, but better safe than sorry :)</div><div><br></div><div>That gives you the best of both worlds. You get some time to debug and if not it will auto reboot after a bit and maybe fix itself :D<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 12, 2024 at 2:21 AM Mark Zhang (NSB) <<a href="mailto:mark.zhang@nokia-sbell.com">mark.zhang@nokia-sbell.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-6129073112551344079">





<div lang="ZH-CN" style="overflow-wrap: break-word;">
<div class="m_-6129073112551344079WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Hello Itxaka,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Thanks for the suggestion.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">If we override with reboot, that may impact the ability of debug in case encountered real issue.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-align:justify"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal" style="text-align:justify"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Mark<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><u></u> <u></u></span></p>
<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(225,225,225) currentcolor currentcolor;padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:"Calibri",sans-serif"> Itxaka Serrano Garcia <<a href="mailto:itxaka.garcia@spectrocloud.com" target="_blank">itxaka.garcia@spectrocloud.com</a>>
<br>
<b>Sent:</b> 2024</span><span style="font-size:11pt">年</span><span lang="EN-US" style="font-size:11pt;font-family:"Calibri",sans-serif">6</span><span style="font-size:11pt">月</span><span lang="EN-US" style="font-size:11pt;font-family:"Calibri",sans-serif">11</span><span style="font-size:11pt">日</span><span lang="EN-US" style="font-size:11pt;font-family:"Calibri",sans-serif">
 16:08<br>
<b>To:</b> Mark Zhang (NSB) <<a href="mailto:mark.zhang@nokia-sbell.com" target="_blank">mark.zhang@nokia-sbell.com</a>><br>
<b>Cc:</b> <a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<b>Subject:</b> [External] Re: [systemd-devel] How to set the timeout of emergency mode<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100%">
<tbody>
<tr>
<td style="background:rgb(255,185,0);padding:5pt 2pt">
<p class="MsoNormal">
<span lang="EN-US" style="color:black"> </span><span lang="EN-US"><u></u><u></u></span></p>
</td>
<td width="100%" style="width:100%;background:rgb(255,248,229);padding:5pt 4pt 5pt 12pt">
<div>
<p class="MsoNormal">
<b><span lang="EN-US" style="font-family:"Arial",sans-serif;color:rgb(34,34,34)">CAUTION:</span></b><span lang="EN-US" style="font-family:"Arial",sans-serif;color:rgb(34,34,34)"> This is an external email. Please be very careful when clicking links or opening attachments.
 See <a href="http://nok.it/nsb" target="_blank">http://nok.it/nsb</a> for additional information.<u></u><u></u></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:等线"><br>
<br>
 <u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:等线">Maybe you could override the emergency.service to reboot automatically? Either on the ExecStartPost or even earlier if you dont want to even show the logging, on ExecStartPre?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:等线"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:等线">I think that could work.<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:等线"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:等线">On Tue, Jun 11, 2024 at 5:19</span><span lang="EN-US" style="font-size:10pt;font-family:"Times New Roman",serif"> </span><span lang="EN-US" style="font-size:10pt;font-family:等线">AM
 Mark Zhang (NSB) <<a href="mailto:mark.zhang@nokia-sbell.com" target="_blank">mark.zhang@nokia-sbell.com</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hello Experts,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Consult one question about how to set the timeout of emergency mode?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Scenario:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">We have encountered one problem of Openstack host, and the host was up at the end, and all things are good from host level after that.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But the VM stuck in the emergency mode forever. If we input ctrl+D, the VM could reboot normally again.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">So we would like to consult, if any method could avoid to stuck in the emergency mode forever? Be better, there is some timeout setting for emergency mode. Then
 the VM could auto-recover by itself for such scenario.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Mark<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>

</div></blockquote></div>