<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Andrei Borzenkov <arvidjaar@gmail.com><br>
<b>Sent:</b> Sunday, May 12, 2024 6:44 PM<br>
<b>To:</b> Carolina Jubran <cjubran@nvidia.com>; systemd-devel@lists.freedesktop.org <systemd-devel@lists.freedesktop.org><br>
<b>Subject:</b> Re: [systemd-devel] Questions about initrd environment services and IgnoreOnIsolate</span>
<div> </div>
</div>
<div class="elementToProof" style="font-size: 11pt;">External email: Use caution opening links or attachments<br>
<br>
<br>
On 12.05.2024 18:19, Carolina Jubran wrote:<br>
>> Hello!<br>
>><br>
>> I need help with a systemd service that loads RDMA and InfiniBand drivers. The service unit specifies DefaultDependencies=no. However, when the service starts in initrd, it gets terminated when initrd-cleanup.service isolates for initrd-switch-root.target
in the middle of the initialization.<br>
>><br>
><br>
>Then make your service<br>
><br>
>Before=initrd-switch-root.target</div>
<div class="elementToProof" style="font-size: 11pt;"><br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">Even with 'Before=initrd-switch-root.target', the service remains susceptible to termination. Hence, I presume 'initrd.target' would be a more appropriate dependency?</span></div>
<div class="elementToProof" style="font-size: 11pt;">><br>
>assuming it is added to the default transaction. You need to make sure<br>
>your service is not considered started until drives are loaded.<br>
></div>
<div class="elementToProof" style="font-size: 11pt; color: rgb(0, 0, 0);"><br>
</div>
<div class="elementToProof" style="color: rgb(0, 0, 0);"><span style="font-size: 11pt;">What steps can I take to ensure that my service is not
</span><span style="font-family: "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255);">considered</span><span style="font-size: 11pt;"> started
until the drivers are loaded?</span></div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);">[Service]</div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);">Type=oneshot</div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);">RemainAfterExit=yes</div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);">ExecStart=/lib/systemd/systemd-modules-load /etc/rdma/modules/%I.conf</div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);">TimeoutSec=90s</div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);"><br>
</div>
<div style="font-size: 11pt; color: rgb(0, 0, 0);">I attempted to utilize ExecStartPre instead of ExecStart, but systemd indicated that the unit file is missing ExecStart or ExecStop</div>
<div class="elementToProof" style="font-size: 11pt; color: rgb(0, 0, 0);"><br>
</div>
<div class="elementToProof" style="font-size: 11pt;">>> My first question is, what are the correct dependencies required to run this service in the initrd environment? I tried adding IgnoreOnIsolate=true under the Unit section, and it helped, but I'm unsure
if that is the correct solution.<br>
>><br>
>> My second question is, how does IgnoreOnIsolate=true affect the system in initrd? Will this solve the problem, or could it potentially introduce unforeseen issues?<br>
>><br>
>> Thank you,<br>
>> Carolina Jubran<br>
>><br>
<br>
</div>
</body>
</html>