[systemd-devel] systemctl --user user can't restart their own service?

Jeff Solomon jsolomon8080 at gmail.com
Fri Nov 17 18:00:35 UTC 2017


Hi,

Is it by-design that a user can't restart their own user service?

I have worked around this by doing the following:

Override /lib/systemd/system/user at .service with a new file:

/etc/systemd/system/user@<uid>.service

I could have left out the <uid> if I wanted the override to apply to all
users, but in this case, I want it to apply to only a single user.

In user@<uid>.service, I added:

Restart=always

to the [Service] section.

Viola! Now the user can just kill their own service (since they own it
after all) and systemd will restart it for them.

Any problem with this workaround Lennart?

Thanks,

Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20171117/a5f3bd3c/attachment.html>


More information about the systemd-devel mailing list