machine-id in action

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
t42
Level 11
Level 11
Posts: 3724
Joined: Mon Jan 20, 2014 6:48 pm

machine-id in action

Post by t42 »

After some system ( Debian bullsey with Cinnamon DE) modification (see code below) VLC aborted. Anyway can't reproduce that behavior on another Debian 11 system.

Code: Select all

$ sudo chmod 600 /etc/machine-id
$ ll /etc/machine-id
-rw------- 1 root root 33 Jan 24 16:09 /etc/machine-id
$ cat /etc/machine-id
cat: /etc/machine-id: Permission denied
$ vlc
VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e)
[0000557008b0c5b0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
dbus[23870]: D-Bus library appears to be incorrectly set up: see the manual page for dbus-uuidgen to correct this issue. (Failed to open "/var/lib/dbus/machine-id": Permission denied; Failed to open "/etc/machine-id": Permission denied)
  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted
Back to defaults, no errors observed:

Code: Select all

$ sudo chmod 644 /etc/machine-id
$ ll /etc/machine-id
-rw-r--r-- 1 root root 33 Jan 24 16:09 /etc/machine-id
$ cat /etc/machine-id
627abbb966c244358779d20c13e7d709
$ vlc
VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e)
[000055578a2315b0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[000055578a2d1390] main playlist: playlist is empty
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
-=t42=-
t42
Level 11
Level 11
Posts: 3724
Joined: Mon Jan 20, 2014 6:48 pm

Re: machine-id in action

Post by t42 »

Here is a confirmation that Chromium-based browsers are using machine-id. No problems with Firefox or Pale Moon.

Code: Select all

$ sudo chmod 600 /etc/machine-id
$ ll /etc/machine-id
-rw------- 1 root root 33 Jan 13 11:57 /etc/machine-id

$ iridium-browser
$ journalctl --since "30 seconds ago" |grep -i browser_dm_token_storage_linux.cc
May 08 16:10:32 vlm201c chrome[14086]: [14086:14086:0508/161032.559488:ERROR:browser_dm_token_storage_linux.cc(101)] Error: /etc/machine-id contains 0 characters (32 were expected).

$ brave-browser-stable
$ journalctl --since "30 seconds ago" |grep -i browser_dm_token_storage_linux.cc
May 08 16:11:05 vlm201c chrome[14183]: [14183:14183:0508/161105.632425:ERROR:browser_dm_token_storage_linux.cc(94)] Error: /etc/machine-id contains 0 characters (32 were expected).

$ google-chrome-stable
$ journalctl --since "30 seconds ago" |grep -i browser_dm_token_storage_linux.cc
May 08 16:11:45 vlm201c chrome[14360]: [14360:14360:0508/161145.281134:ERROR:browser_dm_token_storage_linux.cc(94)] Error: /etc/machine-id contains 0 characters (32 were expected).
System LM20.1
systemd 245 (245.4-4ubuntu3.6)

Experimenting with machine-id be sure that
file /var/lib/dbus/machine-id
/var/lib/dbus/machine-id: symbolic link to /etc/machine-id
-=t42=-
User avatar
Prsman
Level 4
Level 4
Posts: 398
Joined: Tue Nov 17, 2015 3:15 pm

Re: machine-id in action

Post by Prsman »

t42
Level 11
Level 11
Posts: 3724
Joined: Mon Jan 20, 2014 6:48 pm

Re: machine-id in action

Post by t42 »

It works, though the standard way to change machine-id is

Code: Select all

sudo rm /etc/machine-id
sudo systemd-machine-id-setup
That's enough as /var/lib/dbus/machine-id is a symbolic link to /etc/machine-id
In the Firejail Tips and Tricks article they kill that symbolic link.
so to restore status quo:
sudo ln -sf /etc/machine-id /var/lib/dbus/machine-id

Though the commands in my comment above have demonstrated that Chromium-based browsers are checking machine-id I found no indication that this identifier is transferred to some outside party. I'm not sure that proactive change of the machine-id on each reboot has practical sense. Anyway making it unreadable to anyone as one-time action with sudo chmod 600 /etc/machine-id has permanently effect.
Besides chrome-based browsers, also VLC generates D-Bus error if machine-id is -rw-------
-=t42=-
Locked

Return to “Chat about Linux”