[systemd-devel] (newbie) question: dependency on ldap/kerberos

Lennart Poettering lennart at poettering.net
Wed Jun 15 11:23:28 PDT 2011


On Sun, 05.06.11 03:30, Josh Geisser (josh at gebaschtel.ch) wrote:

> Equals: on boot, start the virtual domain controller, then either wait for this one to become available, or if any other is reachable also good :)
> 
> (Despite an abuse of infrastructure, this actually works quite well, the on-site used severs serving SMB are in either 2min or 15minutes available, regardless of whether the firewall could establish the VPN's)
> 
> Any hint how I can implement this scenario with systemd?

The equivalent of runlevels in systemd is targets. You may have as many
of them as you wish and label them freely. Simply create a file
/etc/systemd/system/foobar.target and write data like the following into it:

<snip>
[Unit]
Description=My Pretty Little Foobar Target
</snip>

And there you have a new target just for yourself. And then you can pull
in other stuff into it, with symlinks in a .wants subdir.

# mkdir -p /etc/systemd/system/foobar.target.wants/
# ln -sf /lib/systemd/system/httpd.service /etc/systemd/system/foobar.target.wants/

And this new target will then pull in httpd. (don't forget to reload the
systemd config with "systemctl daemon-reload".)

You can easily define supersets of other targets with this. For example,
add in everything that is already in multi-user.target:

# ln -sf /lib/systemd/system/multi-user.traget /etc/systemd/system/foobar.target.wants/

You have a lot of flexibility with this.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list