Gentoo Archives: gentoo-dev

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-dev@l.g.o
Cc: lu_zero@g.o
Subject: Re: [gentoo-dev] Reusing systemd unit file format / forking systemd
Date: Sun, 26 May 2013 13:37:25
Message-Id: 20130526163546.22e99903@sf
In Reply to: Re: [gentoo-dev] Reusing systemd unit file format / forking systemd by Luca Barbato
1 On Sun, 26 May 2013 13:59:34 +0200
2 Luca Barbato <lu_zero@g.o> wrote:
3
4 > On 5/26/13 1:15 PM, Michał Górny wrote:
5 > > I'd suspect this is mostly with the growing irritation of systemd
6 > > haters who spawn endless threads about how they hate anything with
7 > > 'systemd' name in it. Plus the people who try hard to port the mistakes
8 > > of OpenRC init scripts to systemd services files.
9 >
10 > Here we have a problem, the people that need more flexibility to
11 > actually get work done will see that the inflexibility of the unit
12 > format will bite them and bite them hard.
13 >
14 > A simple example is something fairly easy for a runscript and quite
15 > annoying for an unit, multiple instances.
16 >
17 > for openrc you can just symlink using a proper pattern and have the
18 > initscript figure the right configuration and which user/chroot use to
19 > drop the daemon.
20
21 You need to name a unit with @ suffix, like openvpn@.service:
22
23 $ cat /etc/systemd/system/openvpn@.service
24 [Service]
25 Type=simple
26 ExecStart=/usr/sbin/openvpn --user openvpn --group openvpn --cd /etc/openvpn --chroot /var/run/openvpn --config %I.conf
27
28 feel free to sprinkle %i (and others) for templating.
29
30 and symlink it as you like. openvpn@×××.service (or openvpn@foo)
31 will be direct analogue to openvpn.foo. (+ foo.service.d with the same(?) override semantics)
32
33 > for systemd you have to copy and edit since most fields are immutable
34 > (some are with special rules).
35
36 .include /path/to/unit
37 OverrideedField = OverridedValue
38 will not help here, right?
39
40 --
41
42 Sergei

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies