You are not logged in.
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
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
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
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