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.
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.
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]
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(-)