On Wed, 20.04.11 16:55, Michael Olbrich (m.olbr...@pengutronix.de) wrote: > > On Wed, Apr 20, 2011 at 04:01:05PM +0200, Lennart Poettering wrote: > > On Wed, 20.04.11 11:24, Michael Olbrich (m.olbr...@pengutronix.de) wrote: > > > > > > 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? > > > > Yes, absolutely. Just place "After=" or "Before=" in the unit files. > > That's not possible. The services would be installed from different > packages. e.g the service to generate ssh-keys is installed with the > openssh package etc. And generating the "After=" or "Before=" in a > post-install script is rather ugly.
Hmm? Just place the After= as needed, it will have no effect if the unit mentioned doesn't exist. After= is very weak, it just covers ordering. It does not pull in any service, all it does is ensure that if the unit you place it in, and the unit you reference with it are both in the bootup transaction one will be order after the other. That's all. Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel