Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Ability to use systemd User= directive #52

Open
rohbotics opened this issue Mar 5, 2017 · 1 comment
Open

Request: Ability to use systemd User= directive #52

rohbotics opened this issue Mar 5, 2017 · 1 comment

Comments

@rohbotics
Copy link

As noted in the docs [1], when using setuidgid, the groups and group permissions for that user are lost, which is pretty annoying for nodes that deal with hardware. Udev fixes do work, but are kind of painful to configure.

With systemd, you can run a service as a specific user, preserving the groups.
In the service section of the unit file you can add something like this:

[Service]
User={USER}

And then remove the setgiduid stuff from the /usr/sbin script, so that the service launches properly as the non-root user.
This would be pretty nice to have, and the sbin script could be kept compatible with upstart by checking if UID=0 before using setgiduid.

@mikepurvis
Copy link
Member

Upstart actually has a similar capability. Historically we've done it this way because of wanting to be able to create directories and chown them as required (eg, the log dir). However, I'd be open to reconsidering this— if you're open to putting some work into it I would love to discuss a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants