我想在我的一个应用程序中使用DBus启动一个systemd服务,它是作为非根用户myuser运行的。为此,我需要设置一个PolicyKit,在其中我使用polkit 0.105,并将以下.pkla文件添加到/etc/polkit-1/localauthority/50-local.d中
Identity=unix-user:myuser
Action=org.freedesktop.systemd1.manage-unit-files;org.freedesktop.systemd1.manage-units
ResultActive=yes
ResultInactive=yesHoewever,这在某种程度上并没有帮助它,因为当Permission denied作为myuser运行时,我仍然会从DBus那里得到错误D4,当root启动时,它就会工作。
据我所知,到目前为止,这实际上是设置它的方法。
我还感到奇怪的是,在执行pkaction时,它什么也不返回。
polkit还需要进一步的设置吗?我刚刚通过apt-get安装在一个Ubunut19.04盒上。
发布于 2019-06-21 15:48:29
在org.freedesktop.systemd1中,用于:
action id="org.freedesktop.systemd1.manage-units"
action id="org.freedesktop.systemd1.manage-unit-files"试着更换线路
auth_admin_keep通过:
yeshttps://unix.stackexchange.com/questions/526208
复制相似问题