Need systemd unit file help.

Michal Schmidt mschmidt at redhat.com
Sun Sep 25 12:01:46 UTC 2011


On Sat, 24 Sep 2011 08:48:16 -0500 Richard Shaw wrote:
> I just took over the akmods package at RPM Fusion and one of the many
> BZ requests is to convert it to systemd.
> 
> The current suggestion is:
> [Unit]
> Description=Builds and install new kmods from akmod packages
> After=syslog.target
> Before=prefdm.service
> 
> [Service]
> Type=oneshot
> ExecStart=-/usr/sbin/akmods --from-init
> 
> [Install]
> WantedBy=multi-user.target
> 
> But this only works for people using the video driver akmod packages.
> There are also other packages such as network drivers and possibly
> others.
> 
> Is there some way to make this more dynamic so that the run
> dependencies can be defined by what akmod packages are installed?
> 
> I think I remember reading a thread where one unit file can call other
> unit files? Is there some way to setup a akmods.d/ type directory
> where the individual akmod driver packages can stick unit files?

You can have every akmod-* package ship
a /lib/systemd/system/akmod-*.target file to specify the ordering, e.g.
akmod-foo-video-driver.target:

 [Unit]
 Description=akmod for foo
 After=akmods.service
 Before=prefdm.service

And ship a symlink
/lib/systemd/system/akmods.service.wants/akmod-*.target


Or, instead of building all the modules from akmods.service, you
can build them using 'akmods --akmod ...' from their own akmod-*.service
where the ordering will be defined as needed.

Michal


More information about the devel mailing list