[systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?

Lennart Poettering mzerqung at 0pointer.de
Mon Jan 11 08:44:19 PST 2016


On Mon, 11.01.16 13:38, John Lane (systemd at jelmail.com) wrote:

> On 11/01/16 13:09, Tomasz Torcz wrote:
> > On Mon, Jan 11, 2016 at 12:39:10PM +0000, John Lane wrote:
> >> I have some services in my initramfs that unlock some crypto volumes to
> >> make the root and some other filesystems available.
> >   This seems relevant:
> > https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/
> >
> Yeah, I read that. But it doesn't explain how to configure a unit. I
> read the bit about processes where the first character of the zeroth
> command line argument is '@' are excluded from the killing spree, but
> not sure how to do that from a unit specification file.

This should be done by the daemons themselves. It's really nothing you
can do properly from the outside.

If daemons shall run from the initrd, they must be prepared for that,
for example never access /var and not assume tmpfiles was run or
suchlike. They must be able to deal with the root file directory being
pivoted away and suchlike. hence: it's really not as easy as just
taking a daemon and calling it slightly differently -- instead the
daemon must be designed for this mode of operation, in which case it
should implement the @ logic natively.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list