8

I tried my luck with:

  dbus-send --system --print-reply  \   
     --dest=org.freedesktop.UDisks \
      /org/freedesktop/UIDisks/devices/md0 \
      org.freedesktop.DBus.Properties.GetAll \
      string:""

If I'm using d-free and send "" as parameter to GetAll I get a long list of output

Trying the code above just gives an error:

Error org.freedesktop.DBus.Error.UnknownMethod: Method "GetAll" with signature "s" on
interface "org.freedesktop.DBus.Properties" doesn't exist

So I'm doing something wrong, but I've no idea what's wrong. I searched for a solution but did not come up with a decent solution. Maybe it's to trivial, but I have no idea....

Friedrich
  • 5,916
  • 25
  • 45

4 Answers4

6

You need to specify interface name as a parameter to GetAll. This example works for me (I have UDisks2 instead of UDisks but otherwise it's similar):

dbus-send --system --print-reply \
   --dest=org.freedesktop.UDisks2 \ 
   /org/freedesktop/UDisks2/block_devices/loop0 
   org.freedesktop.DBus.Properties.GetAll 
   string:"org.freedesktop.UDisks2.Block"
Andrey Sidorov
  • 24,905
  • 4
  • 62
  • 75
  • Sorry if I give in an empty string in d-feet I get:{'DeviceAutomountHint': '', 'DeviceBlockSize': 512L, 'DeviceDetectionTime': 1405083881L, 'DeviceFile': '/dev/md0', 'DeviceFileById': ['/dev/disk/by-id/md-uuid-d56d4165:72b8959a:ea459adc:678b0998', '/dev/disk/by-uuid/0bfac438-3d04-4d4e-a71c-2f4a3e63a8e9'], 'DeviceFileByPath': [], 'DeviceFilePresentation': '/dev/md0', 'DeviceIsDrive': True, 'DeviceIsLinuxDmmp': False, 'DeviceIsLinuxDmmpComponent': False, 'DeviceIsLinuxLoop': False, 'DeviceIsLinuxLvm2LV': False, 'DeviceIsLinuxLvm2PV': False, .... – Friedrich Jul 12 '14 at 06:17
  • So there must be a a awy to really GetAll Properties at once. – Friedrich Jul 12 '14 at 06:22
2

I tried my luck with:

dbus-send --system --print-reply  \   
   --dest=org.freedesktop.UDisks \
    /org/freedesktop/UIDisks/devices/md0 \
    org.freedesktop.DBus.Properties.GetAll \
    string:""

You have a typo in the object path: you put UIDisks instead of UDisks. Fixing that should fix your error.


Addressing your comment on this answer about getting all properties at once, the D-Bus specification doesn’t specify that GetAll should accept an empty string for its interface_name argument, so it’s a bug if any services do accept this. Instead, you must call GetAll once for each of the interfaces on the object.

The easiest way of doing this is to use a higher-level D-Bus utility, like gdbus or D-Feet (as you were trying). dbus-send is designed for simple, low-level interaction with D-Bus services.

$ gdbus introspect --system --dest org.freedesktop.UDisks2 --object-path /org/freedesktop/UDisks2/block_devices/sda1 --only-properties
node /org/freedesktop/UDisks2/block_devices/sda1 {
  interface org.freedesktop.UDisks2.Partition {
    properties:
      readonly u Number = 1;
      …
  };
  interface org.freedesktop.UDisks2.Filesystem {
    properties:
      readonly aay MountPoints = [b'/boot/efi'];
  };
  …
}
Philip Withnall
  • 5,293
  • 14
  • 28
1

After all this years, I finally get around this and found something. Yes, sometimes it takes some time

dbus-send --system --print-reply \--dest=org.freedesktop.UDisks2 \
/org/freedesktop/UDisks2/block_devices/sda1 \
org.freedesktop.DBus.Properties.GetAll \
string:"org.freedesktop.UDisks2.Filesystem"

Works, kind of ot get the Properties of at least the Filesystem interface.

Just took me another few hours to figure out this dbus-send stuff.

Friedrich
  • 5,916
  • 25
  • 45
0

Error org.freedesktop.DBus.Error.UnknownMethod: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist

I have similar problem, I run d-feet, introspect interface, and find out, that I should write not "full/path/to/object", but just "/object", in your case not "/org/freedesktop/UIDisks/devices/md0", but "/md0".

If this not help, try compare all parameters in dbus call with what d-feet show, I'm sure you find you problem.

fghj
  • 8,898
  • 4
  • 28
  • 56