Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 876658 - systemd.eclass: systemd_install_serviced should install to /usr/lib/systemd/system
Summary: systemd.eclass: systemd_install_serviced should install to /usr/lib/systemd/s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-10-10 23:24 UTC by John Helmert III
Modified: 2023-10-01 18:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-10-10 23:24:36 UTC
https://github.com/gentoo/gentoo/blob/303e3432e645f36709ba2feeeb39f7d61edd1843/eclass/systemd.eclass#L248 has:

systemd_install_serviced() {
[...]
	(
		insopts -m 0644
		insinto /etc/systemd/system/"${service}".d
		newins "${src}" 00gentoo.conf
	)
}

According to https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Unit%20File%20Load%20Path, these paths serve these purposes:

/etc/systemd/system	System units created by the administrator
/usr/lib/systemd/system	System units installed by the distribution package manager

systemd.eclass is used via the distribution package manager, so it shouldn't be installing to paths supposed to be utilized by the administrator.

floppym signaled openness to such a change on irc, but a change in install location will require revbumps for all consumers. Luckily, this shouldn't subject users to any changes that they might not be aware of since /etc is CONFIG_PROTECTed and they can choose to keep the file if they've changed it.
Comment 1 Mike Gilbert gentoo-dev 2022-10-11 15:47:17 UTC
I think it would probably be best/safest to introduce a new function to create drop-ins in /lib/systemd/system, and adjust ebuilds to use it.
Comment 2 Mike Gilbert gentoo-dev 2023-09-25 14:50:32 UTC
Naming wise, maybe something like this:

systemd_install_user_dropin [unit name] [file name] [dropin name]
systemd_install_system_dropin [unit name] [file name] [dropin name]
Comment 3 Larry the Git Cow gentoo-dev 2023-10-01 18:16:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=866faf07e36ba85b4c1cce2ac642eb5b7b041f57

commit 866faf07e36ba85b4c1cce2ac642eb5b7b041f57
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2023-09-27 14:08:05 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-10-01 18:16:06 +0000

    systemd.eclass: add systemd_install_dropin
    
    Closes: https://bugs.gentoo.org/876658
    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/33089
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/systemd.eclass | 44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)