[systemd-devel] Cannot call GetUnit method with ssh

Bao Nguyen baondt at gmail.com
Thu Feb 28 11:27:55 UTC 2019


Hi again,

Just would like to update that when i restart dbus service, the issue does
not happen.

Brs,
Bao

On Thu, Feb 28, 2019 at 6:21 PM Bao Nguyen <baondt at gmail.com> wrote:

> Hello everyone,
>
> I am using systemd 228. When the system starts successfully, I tried
> to login to my system via ssh with my one of setting users, and I can
> log in successfully but systemd throws an error message:
>
> "Failed to get unit: Access denied"
>
> When I trace code of systemd, I found the message thrown from the
> method call via sdbus. This is one of function I added in systemd
> source
>
>         r = sd_bus_call_method(
>                         bus,
>                         "org.freedesktop.systemd1",
>                         "/org/freedesktop/systemd1",
>                         "org.freedesktop.systemd1.Manager",
>                         "GetUnit",
>                         &error_message,
>                         &reply_return,
>                         "s", name_unit);
>         if (r < 0) {
>                         return log_errno(r, "Failed to get unit: %s",
> bus_error_message(&error_message, r));
>         }
>
> But somehow it cannot call GetUnit method from interface
> org.freedesktop.systemd1.Manager with error "Access denied". Could you
> please let me know what the error message of this method call means ?
> Does it relate any to user permission and if any setting permission of
> user can cause the method called via sdbus can not retrieve unit
> object path for a unit name during ssh?
>
> Thanks a lot,
> Brs,
> Naruto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190228/4a97eb5c/attachment.html>


More information about the systemd-devel mailing list