问题原文
原帖链接 · Luke · CC BY-SA 3.0
I have a service in the form of a node.js application set up with Systemd on Raspbian Jessie and it is using its own user account. However, I am finding that the service does not run correctly because it does not have the necessary permissions. One of the node modules I installed requires root access. If I run the application manually with sudo everything works fine.
Is there a way to tell systemd to run the service with sudo?
已采纳解答
原帖链接 · HBruijn · CC BY-SA 3.0
tell systemd to run the service with
sudo?
sudo has nothing to with it.
Typically you instruct systemd to run a service as a specific user/group with a User= and Group= directive in the [Service] section of the unit file.
Set those to root (or remove them, as running as root is the default).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
