SystemD: When to start service for file system kernel module

Michal Schmidt mschmidt at redhat.com
Thu May 24 10:27:56 UTC 2012


On 05/23/2012 09:23 PM, Richard Shaw wrote:
> Here's my current service file for SPL:

Lennart already pointed out a major problem, but here are some remarks 
about the unit file itself:

> [Unit]
> Description=Builds and installs new kmods for SPL
> Before=local-fs-pre.target

When you are writing a unit that is meant to be run during an early 
phase of boot (before basic.target), you need:
   DefaultDependencies=no
to avoid an ordering cycle.
And then you can add a sensible subset of the default dependencies manually:
   Conflicts=shutdown.target
   Before=shutdown.target

> [Service]
> Type=oneshot

In oneshot units it often makes sense to use:
   RemainAfterExit=yes

It depends on whether you want to have the command re-run again or not 
when a subsequent request to start the unit comes (be it directly via 
systemctl start, or indirectly via requirement dependencies from other 
units).

> ExecStart=-/usr/sbin/akmods --from-init --akmod spl-kmod
>
> [Install]
> WantedBy=single-user.target

There's no single-user.target. You probably meant sysinit.target.

Michal


More information about the devel mailing list