You are not logged in.
I've got automounting set up using udevil and devmon running as a daemon - I'm doing it this way because most of the time my system runs headless without a desktop environment. However when I do use the desktop environment I'd like drives to open up in a file manager and audio disks to launch vlc etc...
I use XFCE as a desktop environment which provides the option to execute tasks on disk insertion, but this doesn't work at the same time as the devmon background service.
Is there any way to achieve what I'm after?
Thanks,
Last edited by dominic7il (2015-10-09 10:28:50)
Offline
How do you start devmon?
How do you start xfce?
Offline
devmon is initiated via systemd (systemctl enable devmon.service)
xfce is started via lightdm, which in turn is initiated by systemd's graphical.target
Last edited by dominic7il (2015-10-07 16:02:04)
Offline
dominic7il,
If you were wondering where your first post went, I think you hit "report" when you meant "reply". It happens more often than you might imagine ![]()
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
dominic7il,
If you were wondering where your first post went, I think you hit "report" when you meant "reply". It happens more often than you might imagine
Yeah I realised that straight after I'd done it - sorry about that.
Offline
No worries. If that is the worst thing that happens today, I'm doing alright ![]()
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I've been playing around with this some more and ontop of the issue above, it seems devmon is mounting drives as root and are subsequently not writeable by other users. Any ideas?
Offline
Ok still no joy with this - one thing that keeps coming up as I search around is that udisks2 supposedly should handle automounting. How can this be configured are there any udev rule files for this lurking around?
Offline
If you have gvfs installed, it should happen automatically if you are using a dm or you're using startx with a correctly configured ~/.xinitrc. The dbus session bus will start gvfsd which will use udisks2 to mount and unmount devices on the fly. Devices are mounted to /run/media/username/xxxx-xxxx. You can also use the udisksctl command line tool.
Offline
OK thanks what would .xinitrc have to contain in order to start gvfsd?
Offline
It was mandatory to have the following:
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?* ; do
[ -x "$f" ] && . "$f"
done
unset f
fias there was a script in there which ran dbus-launch which would start the session bus. Since this change, the session bus (and hence gvfsd) should now get started without anything special in ~/.xinitrc but you still want the block above as there's a script in there which ensures that your environment variables are correct, otherwise you can experience some unpredictable behaviour - some people reported problems with DISPLAY for instance.
Offline
I just don't get it gvfs is running udisks2 is running but it's not mounting automatically. When I run "udisksctl --monitor" it's detecting the insertion of the device. I'm completely stumped and frustrated I've spent far too long on this.
Offline
Run thunar-volman-settings and ensure that Mount removable drives when hot-plugged and Mount removable media when inserted are ticked. If they aren't ticked, then drives will be detected but will not actually be mounted unless you open Thunar and click on the entry under devices in the shortcuts pane.
Offline
Yeah it works via Thunar but as I said I'm trying to get this to work when no desktop environment is running. Basically the main frontend to this machine is going to be Kodi/XBMC - the way I've got it set up is I have a kodi user who's default session is the kodi.session provided with kodi. I've done some more digging and it seems gvfs-mount doesn't detect a drive being inserted if I'm logged in as this other user. My personal user account and the kodi user account all belong to the same groups, so I don't get it.
Offline
Ok I finally got this working - it's not a clean a solution as I would have liked but it works nonetheless. So firstly it turns out dbus isn't started with the default kodi session file - hence why gvfs-mount wouldn't detect the drive at all. Secondly gvfs on it's own does not automount disks, it's the desktop environment detecting the disks and passing the path to gvfs-mount.
So I found this python script:
https://github.com/xenomachina/gvfs-automount
Which will listen for new disks and pass them over to gvfs mount; I had to remove the block of code that triggers notifications as it screwed up the display when running kodi. I placed the script in the kodi user's home directory and made it executable.
I then created a .profile script within the same directory to launch the script via dbus-launch, which solved the dbus issue as well. The resulting script looked like this:
#!/bin/bash
dbus-launch --exit-with-session /storage/.gvfs_automount.py >/dev/null &Since this is only for the one user it works fine, when I'm in the desktop environment I just let that handle mounting instead. So yeah this was a real pain in the a** and it's not a clean solution - I would have liked a systemwide daemon to handle this for every user; but it works!
Last edited by dominic7il (2015-10-09 10:21:08)
Offline
Glad you managed to get some sort of fix together, even if you're not completely happy with your solution. Don't forget to mark as solved if there are no further issues.
Last edited by Chazza (2015-10-09 09:54:14)
Offline