Re: [systemd-devel] Confusing error message

2015-07-14 Thread Spencer Baugh
Perhaps if there is an issue with polkit (or permissions in general) we should 
always print something like, "Unable to perform action without privileges; try 
again with sudo." in addition to the polkit message.

On July 14, 2015 12:59:53 AM PDT, David Herrmann  wrote:
>Hi
>
>On Tue, Jun 23, 2015 at 4:28 AM, Johannes Ernst
> wrote:
>> $ systemctl restart systemd-networkd
>> Failed to restart systemd-networkd.service: The name
>org.freedesktop.PolicyKit1 was not provided by any .service files
>>
>> $ sudo systemctl restart systemd-networkd
>> Works.
>>
>> Presumably this error message could be improved, in particular
>because that name is indeed not provided by any .service files :-)
>
>So if you're not root, systemctl needs to ask polkit to perform
>authorization. It does this, by sending a dbus message to polkit. If
>that well-known bus-name is not owned by anyone, the error message in
>question gets returned. So with inside knowledge, it does make sense
>;)
>
>Regarding changing this: For debug purposes, it is highly valuable to
>know the cause of failure. This message clearly tells a developer what
>went wrong. Not sure we want to change this. Or more importantly, I'm
>not entirely sure it is easy to change this, as this error is
>generated deep down in the polkit-code.
>We could just throw that message away and always return EPERM. Not
>sure it's worth it, though.
>
>Thanks
>David
>___
>systemd-devel mailing list
>systemd-devel@lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Confusing error message

2015-07-14 Thread David Herrmann
Hi

On Tue, Jun 23, 2015 at 4:28 AM, Johannes Ernst
 wrote:
> $ systemctl restart systemd-networkd
> Failed to restart systemd-networkd.service: The name 
> org.freedesktop.PolicyKit1 was not provided by any .service files
>
> $ sudo systemctl restart systemd-networkd
> Works.
>
> Presumably this error message could be improved, in particular because that 
> name is indeed not provided by any .service files :-)

So if you're not root, systemctl needs to ask polkit to perform
authorization. It does this, by sending a dbus message to polkit. If
that well-known bus-name is not owned by anyone, the error message in
question gets returned. So with inside knowledge, it does make sense
;)

Regarding changing this: For debug purposes, it is highly valuable to
know the cause of failure. This message clearly tells a developer what
went wrong. Not sure we want to change this. Or more importantly, I'm
not entirely sure it is easy to change this, as this error is
generated deep down in the polkit-code.
We could just throw that message away and always return EPERM. Not
sure it's worth it, though.

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Confusing error message

2015-06-22 Thread Johannes Ernst
$ systemctl restart systemd-networkd
Failed to restart systemd-networkd.service: The name org.freedesktop.PolicyKit1 
was not provided by any .service files

$ sudo systemctl restart systemd-networkd
Works.

Presumably this error message could be improved, in particular because that 
name is indeed not provided by any .service files :-)

Cheers,



Johannes.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel