<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="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
>> Hello!<br>
>><br>
>> I have modules that need to be loaded using services because some of<br>
>> them don't autoload their modules.<br>
<br>
>"Modules"? do you mean kmod kernel modules with that?</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
Yes<br>
>> I want the modules to load in initrd, before initrd.target. However,<br>
>> the service is not consistently loading in initrd in the current<br>
>> implementation.<br>
<br>
>If you have kernel modules that to not autoload, it should typically<br>
>suffice to add any kernel modules to a file in /etc/modules-load.d/ in<br>
>the initrd.</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The load of the modules is based on hardware presence, that's why we dont use modules-load.d.</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
>That said, in 2024 kernel modules that do not autoload seems quite out</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
>of place.</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many of these issues have been fixed in recent years, but we still haven't addressed everything.</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
>> To resolve this issue, I added "systemctl add-wants initrd.target<br>
>> A.service" in the dracut configuration.<br>
<br>
>Hmm, I don't follow? what would such a line do to kernel modules?</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
>> Is this sufficient for my setup, or do I need to make any further<br>
>> changes in the systemd side to ensure the correct loading before<br>
>> initrd.target? I'm using systemd-load-modules to load the modules.<br>
<br>
>I am not sure I follow really. That service that needs the kernel<br>
>modules, what kind f service is that?</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
We are trying to load these modules using the service:</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[Service]</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Type=oneshot</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
RemainAfterExit=yes</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
ExecStart=/lib/systemd/systemd-modules-load /etc/rdma/modules/%I.conf</div>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
TimeoutSec=90s</div>
<div class="elementToProof" style="text-align: left; text-indent: 0px; margin: 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
The service itself doesn't use the modules.<br>
>Note that services can add the followng to their deps:<br>
<br>
> Wants=modprobe@foobar.service<br>
> After=modprobe@foobar.service<br>
<br>
>To ensure the kmod "foobar" is definitely loaded before the service<br>
>begins execution.<br>
<br>
>Lennart<br>
<br>
>--<br>
>Lennart Poettering, Berlin</div>
<div id="appendonsend"></div>
<div class="elementToProof" style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="divRplyFwdMsg" dir="ltr"></div>
</body>
</html>