[systemd-devel] Cannot call GetUnit method with ssh

Mantas Mikulėnas grawity at gmail.com
Fri Mar 1 09:33:22 UTC 2019


Does your system have any sort of special setup for /etc or /usr?

It sounds very much like /usr is on a separate filesystem that's not yet
mounted at the time of system boot, so dbus-daemon cannot find its
configuration at that time. When /usr is separate, it must be pre-mounted
by the initramfs.

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

> 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
>>
> _______________________________________________
> 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/20190301/33a63977/attachment.html>


More information about the systemd-devel mailing list