Re: [systemd-devel] [PATCH] hostnamectl: correct IDs for remote hosts

2014-06-03 Thread Lennart Poettering
On Sun, 01.06.14 22:03, Mantas Mikulėnas (graw...@gmail.com) wrote:

 
 On Sun, Jun 1, 2014 at 9:01 AM, Lennart Poettering
 lenn...@poettering.net wrote:
 
  On Sat, 31.05.14 18:21, Rico Sagner (sag...@b1-systems.de) wrote:
 
  Heya!
 
  I think that the two ids would probably be better exposed by PID 1
  istelf, instead of hostnamed. It's a bit difficult to come up with a
  rule which props should be exposed from hostnamed and which ones from
  PID1, but I think the rule should be something along the lines of if
  it's more an automatically determined property than a user or vendor
  chosen one, and if PID 1 knows/caches it anyway then it belongs into PID
  1...
 
  So, could you please move the machine/boot IDs into PID 1 instead of
  hostnamed, next to where the Virtualization/Architecture properties are
  defined?
 
 Out of curiosity, wouldn't the existing
 org.freedesktop.DBus.Peer.GetMachineId() work here?

True. That sounds like a good option. And in fact, we actually have a
high-level wrapper call for that: sd_get_owner_machine_id().

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] [PATCH] hostnamectl: correct IDs for remote hosts

2014-06-03 Thread Lennart Poettering
On Mon, 02.06.14 13:31, Simon McVittie (simon.mcvit...@collabora.co.uk) wrote:

 On 01/06/14 20:03, Mantas Mikulėnas wrote:
  Out of curiosity, wouldn't the existing
  org.freedesktop.DBus.Peer.GetMachineId() work here?
 
 In principle Peer.GetMachineId() returns the D-Bus machine ID
 /var/lib/dbus/machine-id, which in rare cases won't match the systemd
 machine ID /etc/machine-id, unfortunately. (Perhaps systemd's Peer
 implementation prefers the systemd machine ID anyway, though.)

yes, we prefer /etc/machine-id.

If the ids differ then that's a bug really, and we shouldn't try to work
around it...

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] [PATCH] hostnamectl: correct IDs for remote hosts

2014-06-02 Thread Simon McVittie
On 01/06/14 20:03, Mantas Mikulėnas wrote:
 Out of curiosity, wouldn't the existing
 org.freedesktop.DBus.Peer.GetMachineId() work here?

In principle Peer.GetMachineId() returns the D-Bus machine ID
/var/lib/dbus/machine-id, which in rare cases won't match the systemd
machine ID /etc/machine-id, unfortunately. (Perhaps systemd's Peer
implementation prefers the systemd machine ID anyway, though.)

On a distribution that runs the correct setup steps in packages' dpkg
postinst, RPM %post or equivalent, those rare cases are:

* systemd was installed *before* dbus (i.e. systemd-machine-id-setup
  was run before dbus-uuidgen)

* the first dbus version to be installed was one with Bug #77941,
  i.e. 1.8.0 or older (that bug was fixed in 1.8.2)

In practice, most systems won't get into that situation, because
installing dbus before systemd is likely to be more common: the sort of
users and vendors who will install systemd are probably the same sort of
users and vendors who would already have installed dbus, and systemd
packages are likely to have a weak dependency on dbus anyway (e.g. in
Debian, systemd Depends: libdbus-1-3 which Recommends: dbus).

S

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


Re: [systemd-devel] [PATCH] hostnamectl: correct IDs for remote hosts

2014-06-01 Thread Lennart Poettering
On Sat, 31.05.14 18:21, Rico Sagner (sag...@b1-systems.de) wrote:

Heya!

I think that the two ids would probably be better exposed by PID 1
istelf, instead of hostnamed. It's a bit difficult to come up with a
rule which props should be exposed from hostnamed and which ones from
PID1, but I think the rule should be something along the lines of if
it's more an automatically determined property than a user or vendor
chosen one, and if PID 1 knows/caches it anyway then it belongs into PID
1...

So, could you please move the machine/boot IDs into PID 1 instead of
hostnamed, next to where the Virtualization/Architecture properties are
defined?

Also, please use ay instead of s as type for the property (i.e. a
byte-array of the 16 raw uuid bytes instead of an ascii-formatted
string). This is how we encoded UUIDs so far as bus properties, see
machined's machine uuid property (src/machine/machine-dbus.c) for example.

Thanks!

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] [PATCH] hostnamectl: correct IDs for remote hosts

2014-06-01 Thread Mantas Mikulėnas
On Sun, Jun 1, 2014 at 9:01 AM, Lennart Poettering
lenn...@poettering.net wrote:

 On Sat, 31.05.14 18:21, Rico Sagner (sag...@b1-systems.de) wrote:

 Heya!

 I think that the two ids would probably be better exposed by PID 1
 istelf, instead of hostnamed. It's a bit difficult to come up with a
 rule which props should be exposed from hostnamed and which ones from
 PID1, but I think the rule should be something along the lines of if
 it's more an automatically determined property than a user or vendor
 chosen one, and if PID 1 knows/caches it anyway then it belongs into PID
 1...

 So, could you please move the machine/boot IDs into PID 1 instead of
 hostnamed, next to where the Virtualization/Architecture properties are
 defined?

Out of curiosity, wouldn't the existing
org.freedesktop.DBus.Peer.GetMachineId() work here?


 Also, please use ay instead of s as type for the property (i.e. a
 byte-array of the 16 raw uuid bytes instead of an ascii-formatted
 string). This is how we encoded UUIDs so far as bus properties, see
 machined's machine uuid property (src/machine/machine-dbus.c) for example.

 Thanks!

 Lennart

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