You are not logged in.

#1 2019-09-12 13:08:33

TonySpark
Member
Registered: 2016-12-09
Posts: 6

Figuring out which version of udisks is in use

I am using a script that runs 'udiskctl mount' at some point. It then assumes that the volume was mounted to '/media/$USER/$VOLUME'. From my understanding, the newer versions (udisks2) now mounts the volumes at '/run/media/$USER/$VOLUME', which causes the script to fail.

I would like to modify the script to act differently depending on the version of udisks, but I cannot find a command such as 'udisksctl --version'. I think I could check for the presence of '/etc/udisks2/', but I am not sure that would be a strong check (is it possible to have udisks2 installed but still use udisks v1, or is it possible that this directory is located somewhere else for another machine?).

Offline

#2 2019-09-12 13:42:45

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: Figuring out which version of udisks is in use

udisks v1 is no longer provided in official repositories.
So it should not be running in your system.

$ journalctl -b | grep "udisks daemon version"

But it is possible to change the behavior of udisks2 with a udev rule setting the UDISKS_FILESYSTEM_SHARED device property for the device you want to mount in a /media directory.

See man udisks:

UDISKS_FILESYSTEM_SHARED
           If set to 1, the filesystem on the device will be mounted in a shared directory (e.g.  /media/VolumeName) instead of a private directory
           (e.g.  /run/media/$USER/VolumeName) when the Filesystem.Mount() method is handled.

Offline

#3 2019-09-12 13:49:40

TonySpark
Member
Registered: 2016-12-09
Posts: 6

Re: Figuring out which version of udisks is in use

Thanks for the help ! the journalctl command does give me the version, but is OS dependent (i.e. if I include that in my script it would only work for systems with systemd),

I did try the UDISKS_FILESYSTEM_SHARED solution but it only allows to mount to /media/VolumeName, while the older version of udisks that I try to be compatible with mount to /media/$USER/VolumeName

Offline

#4 2019-09-12 14:07:41

Swiggles
Member
Registered: 2014-08-02
Posts: 266

Re: Figuring out which version of udisks is in use

According to the man page of udisksctl the mount option returns the mount path to stdout. So this should solve the issue itself, right? No need to figure it out yourself.

Offline

Board footer

Powered by FluxBB