<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=us-ascii">
<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:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@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-CA" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<div id="mail-editor-reference-message-container">
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">> > I think the SIGHUP must come from the new PID 1.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> I don't know if this will help you, however here is a program that I<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> wrote last year that starts a service in the initramfs, it survives<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> the systemd killing spree during the transition to the root<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> filesystem, a new copy of the program is started from the root<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> filesystem, the previous running state is passed from the initramfs to<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> the version started from the root filesystem, and the version started<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> from the initramfs is gracefully shut down. The program does not have<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> the SIGHUP issue that you describe, so maybe there's something here<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> that may help you.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <a href="https://github.com/masneyb/early-service-example">
https://github.com/masneyb/early-service-example</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks very much for this pointer!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I will take a closer look at your code since I would indeed prefer to start my process (and systemd-bootchart) in the initrd.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I had tried doing that using "rdinit=" and did observe that the SIGHUP problem does not occur in that case (btw, it is SIGHUP followed by SIGCONT).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">For systemd-bootchart, after it does some initial set-up, it only reads files under /proc (and it keeps a directory stream to /proc open).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Unfortunately, the switch-root operation somehow causes /proc/schedstat to become inaccessible, so systemd-bootchart is broken with "rdinit=" as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-James M<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>