Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [RFC] Encouraging using hardening options in systemd units
Date: Thu, 25 Aug 2022 18:17:49
Message-Id: CAJ0EP400fj=mv95McVGCEqJ47bO-wGfO4cs3C4kt7st1_x8gvw@mail.gmail.com
In Reply to: Re: [gentoo-dev] [RFC] Encouraging using hardening options in systemd units by Kenton Groombridge
1 On Thu, Aug 25, 2022 at 1:41 PM Kenton Groombridge <concord@g.o> wrote:
2 >
3 > On 22/08/25 01:04PM, Mike Gilbert wrote:
4 > > We could introduce a new function to install distro-specific overrides
5 > > in [/usr]/lib/systemd/system.
6 > >
7 >
8 > I think that's a good idea. systemd_{new,do}serviceconf maybe?
9 >
10 > As I understand it these should go to /usr/lib/[...].
11
12 The correct path to use depends on the type of unit and the
13 "split-usr" USE flag.
14
15 With split-usr enabled, overrides for system service units go in
16 /lib/systemd/system/foo.service.d.
17 With split-usr disabled, overrides for system services units go in
18 /usr/lib/systemd/system/foo.service.d.
19 Overrides for user service units would always go in
20 /usr/lib/systemd/user/foo.service.d.
21
22 We will be phasing out split-usr later this year due to pressure from
23 systemd upstream to stop supporting it.
24
25 Anyway, there are already functions to get the correct path based on
26 pkg-config in the systemd.eclass.