________________________________ From: Andrei Borzenkov <arvidj...@gmail.com> Sent: Sunday, May 12, 2024 6:44 PM To: Carolina Jubran <cjub...@nvidia.com>; systemd-devel@lists.freedesktop.org <systemd-devel@lists.freedesktop.org> Subject: Re: [systemd-devel] Questions about initrd environment services and IgnoreOnIsolate
External email: Use caution opening links or attachments On 12.05.2024 18:19, Carolina Jubran wrote: >> Hello! >> >> 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. >> > >Then make your service > >Before=initrd-switch-root.target Even with 'Before=initrd-switch-root.target', the service remains susceptible to termination. Hence, I presume 'initrd.target' would be a more appropriate dependency? > >assuming it is added to the default transaction. You need to make sure >your service is not considered started until drives are loaded. > What steps can I take to ensure that my service is not considered started until the drivers are loaded? [Service] Type=oneshot RemainAfterExit=yes ExecStart=/lib/systemd/systemd-modules-load /etc/rdma/modules/%I.conf TimeoutSec=90s I attempted to utilize ExecStartPre instead of ExecStart, but systemd indicated that the unit file is missing ExecStart or ExecStop >> 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. >> >> 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? >> >> Thank you, >> Carolina Jubran >>