[systemd-devel] Restarting a service as user instead as root

Silvio Knizek killermoehre at gmx.net
Mon Aug 13 09:51:46 UTC 2018


Am Montag, den 13.08.2018, 11:28 +0200 schrieb Cecil Westerhof:
> I have a service that is run as a different user as root. But only
> root can
> restart the service. Is there a way to make 'systemctl restart' work
> for
> the user that runs the service?

Hi,

you can either define a sudo-rule or you use policykit (polkit) for
this. See 
https://wiki.archlinux.org/index.php/Polkit#Allow_management_of_individual_systemd_units_by_regular_users
 for an example. Keep in mind that the polkit feature depends on your
available systemd version.

BR



More information about the systemd-devel mailing list