I am using Red Hat 7.2 and I need to run user daemon. As said here https://access.redhat.com/solutions/1293513 Red Hat 7 doesn't support user mode of systemd. My main goal is to start different instance of single daemon that will be used by owner user. Can anyone suggest some alternative ways of doing this without systemd user mode?

  • The document needs login, not worth. Why can't simply use polkit rules? At least Arch supports it. – 炸鱼薯条德里克 Jun 7 at 2:44

https://access.redhat.com/solutions/1293513, after discussing --user, says RH doesn't generally support the ability of regular users to stop and start system daemons; it then goes on to show how to set up sudo to allow those users to become admin to start a given daemon (like a log daemon which runs as root). But the article misses the crux of OP's question, which seems to be allowing a user to control a process in systemd running as that user; not a system daemon but a user-level daemon. --User touches on it but the article veers off quickly on a tangent.

I suspect they want you to figure out that copies of a given service can be started as root but them drop permissions and become a user for the duration of the command. You need to find out how to drop from root to (eg) testuser ID and permissions, just as the moin service starts.

In short: a user will need to elevate to root to enable or control a daemon that itself drops to a user permissions as part of the start script. Many daemons (eg ntpd -u) will drop permissions as part of invocation, and via that method we can have users controlling user daemons without using the --user part of the systemd fridge-art that RH itself even hates.

Yes, it briefly becomes root, and yes, that's a security concern; and yes, it'd be better if the parent company supported all the pieces of its favourite son's favourite son. But we have what we have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.