<div dir="ltr"><div><div>Some guys set the following config in /etc/polkit-1/rules.d:<br><br>polkit.addRule(function(action, subject) {<br> if (<a href="http://action.id">action.id</a> == "org.freedesktop.hostname1.set-hostname" &&
subject.user == "systemd-network") {<br> return polkit.Result.YES;<br> }<br>});<br><br></div>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):<br><br>[Allow systemd-networkd to set transient hostname from DHCP]<br>Identity=unix-user:systemd-network<br>Action=org.freedesktop.hostname1.set-hostname<br>ResultAny=yes<br>ResultInactive=yes<br>ResultActive=yes<br><br></div>Good luck!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-02 9:00 GMT-03:00 Alessio Igor Bogani <span dir="ltr"><<a href="mailto:alessioigorbogani@gmail.com" target="_blank">alessioigorbogani@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On 29 September 2015 at 13:53, Alessio Igor Bogani<br>
<span class=""><<a href="mailto:alessioigorbogani@gmail.com">alessioigorbogani@gmail.com</a>> wrote:<br>
> Hi David,<br>
><br>
> On 28 September 2015 at 16:05, David Timothy Strauss<br>
> <<a href="mailto:david@davidstrauss.net">david@davidstrauss.net</a>> wrote:<br>
>> On Mon, Sep 28, 2015 at 1:19 AM Alessio Igor Bogani<br>
>> <<a href="mailto:alessioigorbogani@gmail.com">alessioigorbogani@gmail.com</a>> wrote:<br>
> [...]<br>
>>> The systemd 219 brought with Yocto "Fido" can't set hostname supplied<br>
>>> by DHCP on my Beaglebone:<br>
> [...]<br>
>> "Could not set hostname: No route to host" sounds like systemd is trying to<br>
>> resolve and ping the provided hostname. But, it's failing, and so systemd is<br>
>> deciding that it's not a usable hostname. Doesn't seem related to the DHCP<br>
>> protocol implementation at all.<br>
<br>
</span>If I enable debug:<br>
Oct 02 08:10:43 localhost systemd-networkd[277]: Got message<br>
type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a<br>
member=n/a cookie=5 reply_cookie=12 error=The name<br>
org.freedesktop.PolicyKit1 was not provided by any .service files<br>
Oct 02 08:10:43 localhost systemd-networkd[277]: eth0: Could not set<br>
<span class="">hostname: No route to host<br>
<br>
</span>Evidently Yocto builds systemd enabling polkit without provides it. So<br>
I added it and an additional polkit's rule<br>
(<a href="https://bugs.freedesktop.org/show_bug.cgi?id=81626" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=81626</a>) and my Beaglebone<br>
retrieve and set host-name correctly.<br>
<br>
I would prefer avoid PolicyKit. Moreover in the systemd 219's README<br>
PolicyKit is stated as optional (line 141). So I have rebuild systemd<br>
disabling policykit explicitly and it doesn't work:<br>
<br>
Oct 02 13:35:10 localhost systemd-networkd[235]: Got message<br>
type=error sender=:1.4 destination=:1.2 object=n/a interface=n/a<br>
member=n/a cookie=4 reply_cookie=12 error=Permission denied<br>
Oct 02 13:35:10 localhost systemd-networkd[235]: eth0 :<br>
Could not set hostname: Permission denied<br>
<br>
Do you have any tips?<br>
<br>
Thank in advance!<br>
<br>
Ciao,<br>
<div class="HOEnZb"><div class="h5">Alessio<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><b>Laércio de Sousa</b><br></div><div style="text-align:center"><div style="text-align:left"><i>Orientador de Informática</i></div><div style="text-align:left"><u>Escola Municipal "Professor Eulálio Gruppi"</u></div><div style="text-align:left"><i>Rua Ismael da Silva Mello, 559, Mogi Moderno</i></div><i><div style="text-align:left"><i>Mogi das Cruzes - SP</i></div><div style="text-align:left"><i>CEP 08717-390</i></div></i></div><div><span style="font-family:arial;font-size:small">Telefone: (11) 4726-8313</span></div></div></div>
</div>