systemd / pystemd

A thin Cython-based wrapper on top of libsystemd, focused on exposing the dbus API via sd-bus in an automated and easy to consume way.
GNU Lesser General Public License v2.1
409 stars 36 forks source link

EnableUnitFiles fails because Interactive authentification is required #56

Closed Yuusha0 closed 2 years ago

Yuusha0 commented 4 years ago

Trying to Enable unit with EnableUnitFiles fails with pystemd.dbusexc.DBusInteractiveAuthorizationRequiredError. I cannot find a way in pystemd to enable Interactive Authorization.

You can find a test case here : https://framabin.org/p/?d1d698c4f63daad7#nguiuyQ77FS4PIntbRr7RMTy5Lko/nNyAu//Z3M5Wyk=.

This functionality is implemented in other python dbus like dbus-next. And it is implemented in Perl too. You can found an example of usage in Perl here.

davide125 commented 3 years ago

cc @aleivag, it looks like this is handled upstream by https://www.freedesktop.org/software/systemd/man/sd_bus_message_set_allow_interactive_authorization.html

aleivag commented 3 years ago

i'll check when was that added to systemd interface ... if we implement that, that means that pystemd will stop working for older versions of systemd.

davide125 commented 3 years ago

Looks like this goes back to 220, so it's probably ok: https://github.com/systemd/systemd/commit/c0765ddb74f20046c406a3ac99f34719d767f151

rschwiebert commented 3 years ago

I might be the only one who doesn't see this, but do the above three comments mean that there is now a workaround? Could we elaborate on that, if so?

davide125 commented 2 years ago

This is fixed in https://github.com/facebookincubator/pystemd/commit/505e2b55276a61821a61c43e22ddf108df3080c7