[systemd-devel] org.freedesktop.systemd1.manage-units - which unit?

Mantas Mikulėnas grawity at gmail.com
Thu Sep 26 16:49:44 UTC 2019


In JS-based polkit rules, the action usually comes with 'unit' and 'verb'
polkit variables -- according to src/core/dbus-unit.c:

    if (action.id == "org.freedesktop.systemd1.manage-unit" &&
action.lookup("unit") == "foo.service") { return polkit.Result.YES; }

In older polkit versions which use .pkla rules, variables are not available
at all.

On Thu, Sep 26, 2019 at 6:15 PM Ian Pilcher <arequipeno at gmail.com> wrote:

> I am writing a PolicyKit rule to allow a non-root user to restart a
> service (via D-bus).  It looks like this will be the
> org.freedesktop.systemd1.manage-units "action", but I can't see a way to
> determine *which* unit is being managed (or what the action is - start/
> stop/restart/reload).
>
> Are there any variables associated with this action that my rule can
> use?  If not, is there any way to give a particular user permission to
> perform only some actions on only some units?
>
> Thanks!
>
> --
> ========================================================================
> Ian Pilcher                                         arequipeno at gmail.com
> -------- "I grew up before Mark Zuckerberg invented friendship" --------
> ========================================================================
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190926/10411139/attachment.html>


More information about the systemd-devel mailing list