Article 5CVN4 Is auto-storage detection / auto-mount broken since changing to elogind?

Is auto-storage detection / auto-mount broken since changing to elogind?

by
ordealbyfire83
from LinuxQuestions.org on (#5CVN4)
As the title suggests, I seem to be unable to detect or mount removable media using things like udisks(2) or "gio mount" using BLFS 9.1 with elogind. I want to test that this actually works, because I ultimately intend to build a working Mate Desktop, for which Caja uses such things. As it stands, these tools do not work as advertised.

First of all, I can verify that such tools work with BLFS-7.5 and ConsoleKit(1), gvfs-1.12, and glib-2.40. The trick is that you need an "active" ConsoleKit session. To get this active session, I start a simple xterm/TWM terminal from my graphical display manager. I have a desktop entry in /usr/share/xsessions which points to a script that executes

Code:exec dbus-launch --sh-syntax --exit-with-session xtermI can then verify that the resulting session is active using ck-list-sessions. Then, I launch gtk-demo, and find the file picker tool. You can see external devices plugged in, and so forth. I can also use gvfs-mount to mount flash drives and so forth. Again, the key here is that Polkit verification does not work unless the session is active. And, I reiterate that this all works without a desktop environment running.

Fast forward to 2020, with a new version of that damned octopus glib, udisks2 with a ridiculous amount of dependencies, and so forth. Add elogind to the mix and this is now a whole different operating system.

udisksctl does not work:

Code:user@host:~$ udisksctl mount -b /dev/sdb1
Error looking up object for device /dev/sdb1Is that even supposed to be meaningful output? gio mount apparently uses this; if I run 'top' I can see for my user the /usr/libexec/gvfs-* tools. I presume the udisks-2 gvfs tool would be used, so we should just look directly at udisks2/udisksctl.

I presume that my session is "active" since the gvfs-* tools are running, though I am unsure how to verify this using loginctl list-sessions. Is there any other troubleshooting for udisks(2)? Also, gtk-demo does not show any new devices should I plug in some other drive, so auto-detection is not working either.

This stuff really makes me want to quit Linux entirely. If these things don't work, then at the very least they should be removed from the BLFS book. That glib (!) now internally handles mounting in user-space (ie presuming the presence and configuration of polkit and udisks2, while never checking for such things at configure time) is absolutely abhorrent. (And by the way, gio stands for Gnome In/Out, so glib is now a Gnome library, and we're expecting good results using Gnome libraries in a non-Gnome environment.) The innocent sounding description of glib as 'a library of C functions' is an outright lie. Likewise gtk2/3 both assume the presence of such tools in the gtkfilesystem.{c,h} which are anything but clear to read.latest?d=yIl2AUoC8zA latest?i=khHM9nWnd4s:VNVRa9aS4xM:F7zBnMy latest?i=khHM9nWnd4s:VNVRa9aS4xM:V_sGLiP latest?d=qj6IDK7rITs latest?i=khHM9nWnd4s:VNVRa9aS4xM:gIN9vFwkhHM9nWnd4s
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments