Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-05 Thread Jan Alexander Steffens
On Mon, Oct 5, 2015 at 8:28 AM, Alessio Igor Bogani
 wrote:
> So I'll install polkit. The only downside is that polkit drag
> Javascript interpreter in which isn't a typical package for an
> embedded system due it's footprint but I suspect that I should live
> with it.  :-)

Yeah, that was a weird design choice - the interpreter even crashes
occasionally.

I hope with the proposed systemd-authorityd we'll have something lean.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-05 Thread Alessio Igor Bogani
Hi,

On 3 October 2015 at 15:34, Lennart Poettering  wrote:
[...]
> Well, we need some kind of policy framework in place there that allows
> the "systemd-networkd" user to set the hostname. If you disable
> PolicyKit you have none, and hence the permission is denied.

So I'll install polkit. The only downside is that polkit drag
Javascript interpreter in which isn't a typical package for an
embedded system due it's footprint but I suspect that I should live
with it.  :-)

Thanks David, Laércio and Lennart!

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


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-05 Thread Mantas Mikulėnas
On Mon, Oct 5, 2015 at 9:28 AM, Alessio Igor Bogani <
alessioigorbog...@gmail.com> wrote:

> Hi,
>
> On 3 October 2015 at 15:34, Lennart Poettering 
> wrote:
> [...]
> > Well, we need some kind of policy framework in place there that allows
> > the "systemd-networkd" user to set the hostname. If you disable
> > PolicyKit you have none, and hence the permission is denied.
>
> So I'll install polkit. The only downside is that polkit drag
> Javascript interpreter in which isn't a typical package for an
> embedded system due it's footprint but I suspect that I should live
> with it.  :-)
>

While I'm not really comfortable suggesting this, old polkit versions
(v0.105 and earlier) used a different rules format without JavaScript.

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


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-03 Thread Lennart Poettering
On Fri, 02.10.15 14:00, Alessio Igor Bogani (alessioigorbog...@gmail.com) wrote:

> I would prefer avoid PolicyKit. Moreover in the systemd 219's README
> PolicyKit is stated as optional (line 141). So I have rebuild systemd
> disabling policykit explicitly and it doesn't work:
> 
> Oct 02 13:35:10 localhost systemd-networkd[235]: Got message
> type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a
> member=n/a cookie=4 reply_cookie=12 error=Permission denied
> Oct 02 13:35:10 localhost systemd-networkd[235]: eth0:
> Could not set hostname: Permission denied
> 
> Do you have any tips?

Well, we need some kind of policy framework in place there that allows
the "systemd-networkd" user to set the hostname. If you disable
PolicyKit you have none, and hence the permission is denied. 

Only other option I see is to run networkd with more caps, but I'd
really avoid that, given that it contains network-facing code.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-02 Thread Laércio de Sousa
Some guys set the following config in /etc/polkit-1/rules.d:

polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.hostname1.set-hostname" &&
subject.user == "systemd-network") {
  return polkit.Result.YES;
}
});

Alternatively, I use the following config in
/etc/polkit/localauthority/50-local.d of my Debian Jessie installation (I
failed to make it apply polkit rules):

[Allow systemd-networkd to set transient hostname from DHCP]
Identity=unix-user:systemd-network
Action=org.freedesktop.hostname1.set-hostname
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Good luck!

2015-10-02 9:00 GMT-03:00 Alessio Igor Bogani :

> Hi,
>
> On 29 September 2015 at 13:53, Alessio Igor Bogani
>  wrote:
> > Hi David,
> >
> > On 28 September 2015 at 16:05, David Timothy Strauss
> >  wrote:
> >> On Mon, Sep 28, 2015 at 1:19 AM Alessio Igor Bogani
> >>  wrote:
> > [...]
> >>> The systemd 219 brought with Yocto "Fido" can't set hostname supplied
> >>> by DHCP on my Beaglebone:
> > [...]
> >> "Could not set hostname: No route to host" sounds like systemd is
> trying to
> >> resolve and ping the provided hostname. But, it's failing, and so
> systemd is
> >> deciding that it's not a usable hostname. Doesn't seem related to the
> DHCP
> >> protocol implementation at all.
>
> If I enable debug:
> Oct 02 08:10:43 localhost systemd-networkd[277]: Got message
> type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a
> member=n/a cookie=5 reply_cookie=12 error=The name
> org.freedesktop.PolicyKit1 was not provided by any .service files
> Oct 02 08:10:43 localhost systemd-networkd[277]: eth0: Could not set
> hostname: No route to host
>
> Evidently Yocto builds systemd enabling polkit without provides it. So
> I added it and an additional polkit's rule
> (https://bugs.freedesktop.org/show_bug.cgi?id=81626) and my Beaglebone
> retrieve and set host-name correctly.
>
> I would prefer avoid PolicyKit. Moreover in the systemd 219's README
> PolicyKit is stated as optional (line 141). So I have rebuild systemd
> disabling policykit explicitly and it doesn't work:
>
> Oct 02 13:35:10 localhost systemd-networkd[235]: Got message
> type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a
> member=n/a cookie=4 reply_cookie=12 error=Permission denied
> Oct 02 13:35:10 localhost systemd-networkd[235]: eth0:
> Could not set hostname: Permission denied
>
> Do you have any tips?
>
> Thank in advance!
>
> Ciao,
> Alessio
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>



-- 
*Laércio de Sousa*
*Orientador de Informática*
*Escola Municipal "Professor Eulálio Gruppi"*
*Rua Ismael da Silva Mello, 559, Mogi Moderno*
*Mogi das Cruzes - SPCEP 08717-390*
Telefone: (11) 4726-8313
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-02 Thread Alessio Igor Bogani
Hi,

On 29 September 2015 at 13:53, Alessio Igor Bogani
 wrote:
> Hi David,
>
> On 28 September 2015 at 16:05, David Timothy Strauss
>  wrote:
>> On Mon, Sep 28, 2015 at 1:19 AM Alessio Igor Bogani
>>  wrote:
> [...]
>>> The systemd 219 brought with Yocto "Fido" can't set hostname supplied
>>> by DHCP on my Beaglebone:
> [...]
>> "Could not set hostname: No route to host" sounds like systemd is trying to
>> resolve and ping the provided hostname. But, it's failing, and so systemd is
>> deciding that it's not a usable hostname. Doesn't seem related to the DHCP
>> protocol implementation at all.

If I enable debug:
Oct 02 08:10:43 localhost systemd-networkd[277]: Got message
type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a
member=n/a cookie=5 reply_cookie=12 error=The name
org.freedesktop.PolicyKit1 was not provided by any .service files
Oct 02 08:10:43 localhost systemd-networkd[277]: eth0: Could not set
hostname: No route to host

Evidently Yocto builds systemd enabling polkit without provides it. So
I added it and an additional polkit's rule
(https://bugs.freedesktop.org/show_bug.cgi?id=81626) and my Beaglebone
retrieve and set host-name correctly.

I would prefer avoid PolicyKit. Moreover in the systemd 219's README
PolicyKit is stated as optional (line 141). So I have rebuild systemd
disabling policykit explicitly and it doesn't work:

Oct 02 13:35:10 localhost systemd-networkd[235]: Got message
type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a
member=n/a cookie=4 reply_cookie=12 error=Permission denied
Oct 02 13:35:10 localhost systemd-networkd[235]: eth0:
Could not set hostname: Permission denied

Do you have any tips?

Thank in advance!

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


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-10-02 Thread Tomasz Torcz
On Fri, Oct 02, 2015 at 02:00:21PM +0200, Alessio Igor Bogani wrote:
> Hi,
> 
> On 29 September 2015 at 13:53, Alessio Igor Bogani
>  wrote:
> > Hi David,
> >
> > On 28 September 2015 at 16:05, David Timothy Strauss
> >  wrote:
> >> On Mon, Sep 28, 2015 at 1:19 AM Alessio Igor Bogani
> >>  wrote:
> > [...]
> >>> The systemd 219 brought with Yocto "Fido" can't set hostname supplied
> >>> by DHCP on my Beaglebone:
> > [...]
> >> "Could not set hostname: No route to host" sounds like systemd is trying to
> >> resolve and ping the provided hostname. But, it's failing, and so systemd 
> >> is
> >> deciding that it's not a usable hostname. Doesn't seem related to the DHCP
> >> protocol implementation at all.
> 
> If I enable debug:
> Oct 02 08:10:43 localhost systemd-networkd[277]: Got message
> type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a
> member=n/a cookie=5 reply_cookie=12 error=The name
> org.freedesktop.PolicyKit1 was not provided by any .service files
> Oct 02 08:10:43 localhost systemd-networkd[277]: eth0: Could not set
> hostname: No route to host

  My guess: do you have hostnamed installed?

-- 
Tomasz Torcz   ,,(...) today's high-end is tomorrow's embedded processor.''
xmpp: zdzich...@chrome.pl  -- Mitchell Blank on LKML

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


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-09-29 Thread Alessio Igor Bogani
Hi David,

On 28 September 2015 at 16:05, David Timothy Strauss
 wrote:
> On Mon, Sep 28, 2015 at 1:19 AM Alessio Igor Bogani
>  wrote:
[...]
>> The systemd 219 brought with Yocto "Fido" can't set hostname supplied
>> by DHCP on my Beaglebone:
[...]
> "Could not set hostname: No route to host" sounds like systemd is trying to
> resolve and ping the provided hostname. But, it's failing, and so systemd is
> deciding that it's not a usable hostname. Doesn't seem related to the DHCP
> protocol implementation at all.

This doesn't seem the case:

ssh root@gallinella
root@gallinella's password:
localhost:~# ping gallinella
PING gallinella.elettra.trieste.it (192.168.205.87) 56(84) bytes of data.
64 bytes from gallinella.elettra.trieste.it (192.168.205.87):
icmp_seq=1 ttl=64 time=0.255 ms
64 bytes from gallinella.elettra.trieste.it (192.168.205.87):
icmp_seq=2 ttl=64 time=0.237 ms
64 bytes from gallinella.elettra.trieste.it (192.168.205.87):
icmp_seq=3 ttl=64 time=0.218 ms
^C
--- gallinella.elettra.trieste.it ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.218/0.236/0.255/0.023 ms
localhost:~# cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

nameserver 140.105.4.3
nameserver 140.105.2.5
nameserver 140.105.8.3
search elettra.trieste.it
localhost:~# hostnamectl
   Static hostname: n/a
Transient hostname: localhost
 Icon name: computer
Machine ID: c3f437527c6e4f62a27ec7725dbdef6d
   Boot ID: d74e8174075b458ebe9105d93c83a029
  Operating System: FLOP pre0.5 (fido)
Kernel: Linux 3.14.39ltsi-rt37-yocto-preempt-rt
  Architecture: arm
localhost:~# journalctl -u systemd-networkd.service
-- Logs begin at Tue 2015-09-29 13:32:00 CEST, end at Tue 2015-09-29
13:33:54 CEST. --
Sep 29 13:32:07 localhost systemd[1]: Starting Network Service...
Sep 29 13:32:07 localhost systemd-networkd[231]: Enumeration completed
Sep 29 13:32:07 localhost systemd[1]: Started Network Service.
Sep 29 13:32:08 localhost systemd-networkd[231]: eth0:
eth0: could not bring up interface: Invalid argument
Sep 29 13:32:11 localhost systemd-networkd[231]: eth0:
gained carrier
Sep 29 13:32:11 localhost systemd-networkd[231]: eth0:
DHCPv4 address 192.168.205.87/24 via 192.168.205.1
Sep 29 13:32:11 localhost systemd-networkd[231]: eth0:
link configured
Sep 29 13:32:12 localhost systemd-networkd[231]: eth0:
Could not set hostname: No route to host

Thanks a lot anyway!

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


Re: [systemd-devel] systemd and hostname supplied by DHCP

2015-09-28 Thread David Timothy Strauss
On Mon, Sep 28, 2015 at 1:19 AM Alessio Igor Bogani <
alessioigorbog...@gmail.com> wrote:

> Hi systemd developers and users,
>
> The systemd 219 brought with Yocto "Fido" can't set hostname supplied
> by DHCP on my Beaglebone:
>
> eth0: eth0: could not bring up interface:
> Invalid argument
> eth0: gained carrier
> eth0: DHCPv4 address 192.168.205.87/24 via 192.168.205.1
> eth0: link configured
> eth0: Could not set hostname: No route to host
>

"Could not set hostname: No route to host" sounds like systemd is trying to
resolve and ping the provided hostname. But, it's failing, and so systemd
is deciding that it's not a usable hostname. Doesn't seem related to the
DHCP protocol implementation at all.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd and hostname supplied by DHCP

2015-09-28 Thread Alessio Igor Bogani
Hi systemd developers and users,

The systemd 219 brought with Yocto "Fido" can't set hostname supplied
by DHCP on my Beaglebone:

eth0: eth0: could not bring up interface:
Invalid argument
eth0: gained carrier
eth0: DHCPv4 address 192.168.205.87/24 via 192.168.205.1
eth0: link configured
eth0: Could not set hostname: No route to host

How can I fix this error?

On my desktop machine (Arch Linux with systemd 225) I don't receive
that error message and both use the same DHCP server.

I dumped DHCP protocol to be user that DHCP contains the right
hostname for both machines.

Thank you very much.

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