[systemd-devel] howto migrate some things to systemd
Michael Olbrich
m.olbrich at pengutronix.de
Wed Apr 20 02:24:01 PDT 2011
On Wed, Apr 20, 2011 at 01:21:06AM +0200, Lennart Poettering wrote:
> On Sun, 17.04.11 10:33, Michael Olbrich (m.olbrich at pengutronix.de) wrote:
> > I'm trying to migrate some stuff to systemd, but I have some problems
> > getting it right.
> > The scenario:
> > I'm cross-building root file systems. I try to do as much as possible
> > on the host system, but there is some stuff that needs to run on the target
> > when booting for the first time. I'm not sure how to integrate this with
> > systemd.
> > Some of the issues I have:
> > - With a classic init, the init-script just touches a file to indicate the
> > one-time stuff is complete. Is there a better way for this with
> > systemd?
>
> You could do this too, and then use ConditionFileExists=/flagfile to
> suppress execution of the service.
That's exactly what I'm looking for.
> If this is for SSH keys and stuff you might even want to split this up
> into several units and just look for the sshd key files
> directly. i.e. stick in your ssh-keygen.service something like this:
>
> ConditionFileExists=!/etc/ssh/ssh_host_rsa_key
>
> That way are things are nice and robust. And it comes at the cost of an
> access() syscall. Which I think is pretty cheap.
Hmmm, If I do this then all such tasks would be triggered at the same time,
right? In contrast to the usual startup tasks this stuff is rather resource
intensive. Is there a way to serialize this?
Regards,
Michael Olbrich
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the systemd-devel
mailing list