Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 647440 - net-nntp/sabnzbd-2.3.2 - systemd service should not hard-code user/group
Summary: net-nntp/sabnzbd-2.3.2 - systemd service should not hard-code user/group
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Deutschmann (RETIRED)
URL: https://gitweb.gentoo.org/repo/gentoo...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-12 18:51 UTC by Michael Hampicke
Modified: 2020-06-28 16:06 UTC (History)
2 users (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 Michael Hampicke 2018-02-12 18:51:45 UTC
Hello gentoo folks,

after my sabnzbd instance suddenly stopped working I started to investigate why. After a few minutes I found this commit: https://gitweb.gentoo.org/repo/gentoo.git/commit/net-nntp/sabnzbd?id=ad458c8b83e618bac852ae1bba261a44d727e787

In this commit the correct lines:
-User=%I
-Group=%I

were replaced with:
+User=sabnzbd
+Group=sabnzbd

In my optinion this is wrong. You either have a sabnzbd.service with hard coded user/group or you have a sabnzbd@.service instance with dynamic user (starting/enabling with systemctl enable/start sabnzbd@user.service). You don't do both.

Best regards,
Michael
Comment 1 Justin Bronder (RETIRED) gentoo-dev 2018-02-12 19:43:37 UTC
Adding Mike Crawford to CC.


Michael and Mike, I need you guys to figure this out.  I have no interest in systemd and the service script is essentially maintained by you, the users.  I'm more then happy to commit whatever you guys settle on.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2020-06-28 13:11:32 UTC
I am closing this bug as INVALID:

"service@" notation primary indicates a template (often used by services allowing more than one instance). It has nothing to do with dynamic user feature.

Package is creating an own, dedicated user so it makes sense from my P.O.V. to reference that user by default.

If you want to run as a different user or maybe want to use dynamic user feature instead, you have to overwrite provided unit (which is common in systemd world).

Please correct me if I am wrong.
Comment 3 Michael Crawford (ali3nx) 2020-06-28 16:06:57 UTC
If a user desires to alter the default user provided by systemd service units they have the latitude to use systemctl edit servicename.service to create a  custom override entry for the service username and group the process will be executed by. systemd overrides are also not disturbed by system upgrades.

At the time i submitted the service unit in another bug systemd service user aliases were either broken or not function for reasons i'm unaware of however hardcoding username and group in service unit was a functional resolution for everyone.