xfce4-mount-plugin

Jason Bacon jwbacon at tds.net
Mon Mar 4 18:55:53 UTC 2013


I maintain and develop sysutils/desktop-installer, which began as a 
simple script for setting up XFCE, until I realized that 99% of what it 
does is desktop-independent, so now it supports most common desktops.

Now that xfce4-mount-plugin is available, I'm working on getting CD and 
flash drive mounts working out-of-the-box for members of the operator group.

It's almost there if the following steps are taken:

1) Install the following in sudoers.d/mounts:

%operator ALL=(ALL) NOPASSWD:  /sbin/mount /dev/cd0, /sbin/umount 
/dev/cd0, /sbin/mount /media/cdrom0, /sbin/umount /media/cdrom0, 
/sbin/mount /dev/cd1, /sbin/umount /dev/cd1, /sbin/mount /media/cdrom1, 
/sbin/umount /media/cdrom1, /sbin/mount /dev/da0a, /sbin/umount 
/dev/da0a, /sbin/mount /media/flash_ufs, /sbin/umount /media/flash_ufs, 
/sbin/mount /dev/da0s1, /sbin/umount /dev/da0s1, /sbin/mount 
/media/flash_fat, /sbin/umount /media/flash_fat, /sbin/mount /dev/da0s1, 
/sbin/umount /dev/da0s1, /sbin/mount /media/flash_ntfs, /sbin/umount 
/media/flash_ntfs

An alternative to sudo would be to change the ownership of the mount 
points when a user logs in under XFCE and enable vfs.usermount.  This 
avoids the need for sudo, but limits mounting to users on the console, 
which is probably OK.

2) Add the appropriate fstab entries

3) Configure xfce4-mount-plugin for each user.

4) Put the following in /usr/local/etc/gamin/gaminrc to that gam_server 
doesn't prevent umounts:

poll /media/cdrom0
poll /media/cdrom1
poll /media/flash_ufs
poll /media/flash_fat
poll /media/flash_ntfs

I'd like to find a way to eliminate step 3, so that mounting just works 
for all users in the operator group.

 From my investigation so far, I've found 2 possibilites:

1) Install an appropriate xfce4-mount-plugin-??.rc in 
/usr/local/etc/xdg/xfce4/panel that adds sudo to the mount commands.  
This file will probably be version-specific, so it will have to be 
regenerated with every upgrade of the plugin.

or

2) Patch the source files with the following:

         sed -i '' -e 's|"mount %d"|"sudo mount %d"|g' \
             -e 's|"umount %d"|"sudo umount %d"|g' \
             work/xfce4-mount-plugin-*/panel-plugin/mount-plugin.h

The above only changes the default custom command, but does not affect 
the built-in default if custom commands are not selected.  I haven't 
figured out how to fix this yet.

I also added the following patch, although I'm still uncertain whether 
it's a better default:

         sed -i '' -e \
             's|on_mount_cmd = g_strdup("")|on_mount_cmd = 
g_strdup("thunar %m")
             work/xfce4-mount-plugin-*/panel-plugin/mount-plugin.c

Would you be amenable to changing the default behavior of the port to 
eliminate the need for users to do manual configuration?  If not, I'll 
do some sort of workaround in desktop-installer.

Regards,

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jason W. Bacon
jwbacon at tds.net
http://personalpages.tds.net/~jwbacon
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the freebsd-xfce mailing list