Just a bit of context...
I got some legacy System V Init script that were converted to Systemd unit configuration files for RedHat 7. Problems with abrupt termination of user processes running in the user.slice led me to the discovery that systemd/pam on RedHat 7 require my script to use runuser to switch user (if they are started as root) or User= to make sure they start as the right user. Now to make sure that systemd controls my daemon and starts the service on reboot and to make sure my legitimate users can start the service as well, it seems like I have three options:
- Define a "user" service instead (and use
systemctl --user
) to control it - Allow my user to start/stop the service sudo
sudo systemctl start name.service
- Allow my user to start/stop the service with PolicyKit
So back to the question...
Is sudo still a good way to give my user privileges to control services for RedHat 8? Or should I use PolicyKit as indicated in systemd: Grant an unprivileged user permission to alter one specific service
Thank you. Frank