[gentoo-user] Re: automounting usb drives [SOLVED]
On 02/27/2011 04:54 AM, luis jure wrote: PENDING ISSUE: on thunar (and xfce, the other file manager i occasionally use) i can eject the drive but no umount it (i mean the ability to umount the file system but not delete the mount point under /media) The auth/policy landscape has changed so quickly in the last few months that I can't keep up, but I can tell you that you might want to play with the command-line tools from consolekit and polkit when root-versus-user problems occur. For example, look through the output of pkaction --verbose for this: org.freedesktop.udisks.drive-detach: description: Detach a drive message: Authentication is required to detach the drive vendor:The udisks Project vendor_url:http://udisks.freedesktop.org/ icon: drive-removable-media implicit any: no implicit inactive: no implicit active: yes Look at the last three lines for 'any' 'inactive' and 'active'. What do they mean? They refer to your 'console session', which you can list with ck-list-sessions: Session1: unix-user = '1001' realname = '(null)' seat = 'Seat1' session-type = '' active = FALSE<== NOTE x11-display = '' x11-display-device = '' display-device = '/dev/tty1' remote-host-name = '' is-local = TRUE on-since = '2011-02-27T14:05:03.842279Z' login-session-id = '1' idle-since-hint = '2011-02-27T14:05:40.005781Z' Session2: unix-user = '1001' realname = '(null)' seat = 'Seat1' session-type = '' active = TRUE <=== NOTE x11-display = ':0' x11-display-device = '/dev/tty7' display-device = '/dev/tty1' remote-host-name = '' is-local = TRUE <=== NOTE on-since = '2011-02-27T14:05:16.819654Z' login-session-id = '1' Session1 is my original login on tty1, from which I typed 'startx'. That session is not active because I'm writing this from inside the gnome desktop, i.e. Session2, which *is* active (note the tty7). The old defunct policykit also dictated whether a session had to be 'local' to do certain things, but that may have vanished, dunno. The old policykit came with very simple and understandable tools to set and edit policies, and the defunct gnome-policykit gave you a simple gui frontend so you could tell WTF you were doing. Alas, no more, and the new system is virtually opaque. Not well done, IMHO. My point is (almost forgot it) that automounting stopped working for many months in gnome because consolekit claimed that my ck-session was *not* active and *not* local even though obviously it was both. Some recent update finally fixed that bug, thankfully, but I have no idea which update.
Re: [gentoo-user] Re: automounting usb drives [SOLVED]
on 2011-02-27 at 13:51 Paul Colquhoun wrote: >Hmmm. "equery b" for /etc/PolicyKit/PolicyKit.conf or >just /etc/PolicyKit doesn't return any packages on my system. from what i could find on the web, it seems to me that /etc/PolicyKit/PolicyKit.conf belongs to a deprecated policykit package, superseded (at least on my system) by polkit, the configuration files of which are under /etc/polkit-1 now, i found lots of examples on the web how to configure the old PolicyKit.conf file to allow normal users mount usb devices, but it took some time to find out how to configure the polkit files. here's what i found, and it works: /etc/polkit-1/localauthority.conf.d/50-localauthority.conf : [Configuration] AdminIdentities=unix-group:wheel /etc/polkit-1/localauthority/50-local.d/11-my-polkit-udisks.pkla [udisks full access] Identity=unix-user: Action=org.freedesktop.udisks.* ResultAny=yes [http://forums.gentoo.org/viewtopic-t-858965-postdays-0-postorder-asc-start-25.html] i guess that in the second file i could also use unix-group:wheel (or users or whatever) instead of unix-user, but i'm the only one using this machine, so it's just as well. now automounting "just works", without needing anything else, like udev rules or additional automonting packages. PENDING ISSUE: on thunar (and xfce, the other file manager i occasionally use) i can eject the drive but no umount it (i mean the ability to umount the file system but not delete the mount point under /media) a big thank you (und vielen dank) to everybody! lj
Re: [gentoo-user] Re: automounting usb drives
On Sun, 27 Feb 2011 13:10:37 luis jure wrote: > on 2011-02-27 at 11:32 Paul Colquhoun wrote: > >If it involved PolicyKit, that may be the cause. Look in > >/etc/PolicyKit/PolicyKit.conf and see if that is blocking your access. > > mmm... i don't have this file (or the /etc/PolicyKit directory, for that > matter). i only have the /etc/polkit-1 directory, belonging to > sys-auth/polkit. > > the PolicyKit.conf file should already be there? which package provides > it? or can i just create it from scratch? Hmmm. "equery b" for /etc/PolicyKit/PolicyKit.conf or just /etc/PolicyKit doesn't return any packages on my system. I suspect that they belong to some part of KDE, as the permission errors I was tracking down came from the Dolphin file manager, and they could thus control how KDE uses the policykit framework. They may also be leftovers from when KDE/Gentoo used to use policykit, and have since stopped. It's sometimes hard to keep up with these changes. It's possible that I created the file and directory by hand, after finding instructions via Google search, such as https://bbs.archlinux.org/viewtopic.php?id=65070 In case you want to risk this, the full content of my file is: # http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd";> # -- Reverend Paul Colquhoun, ULC.http://andor.dropbear.id.au/~paulcol Before you criticize someone, you should walk a mile in their shoes. Then, when you do, you'll be a mile away, and you'll have their shoes.
Re: [gentoo-user] Re: automounting usb drives
on 2011-02-27 at 11:32 Paul Colquhoun wrote: >If it involved PolicyKit, that may be the cause. Look in >/etc/PolicyKit/PolicyKit.conf and see if that is blocking your access. mmm... i don't have this file (or the /etc/PolicyKit directory, for that matter). i only have the /etc/polkit-1 directory, belonging to sys-auth/polkit. the PolicyKit.conf file should already be there? which package provides it? or can i just create it from scratch? best, lj
Re: [gentoo-user] Re: automounting usb drives
On Sun, 27 Feb 2011 11:04:41 luis jure wrote: > on 2011-02-26 at 14:44 walt wrote: > >xfce4-session also recognizes the policykit and consolekit USE flag, and > >those two things seem to be the way of the future (until tomorrow, anyway) > >for desktop managers like kde and gnome. > > > >xfce has always been closely related to gnome, and it still uses the gnome > >USE flag, I see. I'd suggest setting the three USE flags I've mentioned > >and see what happens. > > OK, i undid everything i had been trying and decided to try this path. i > recompiled xfce4-session with policykit, consolekit and gnome. > > i don't have a graphical login manager, i start X with startx from the > console, and my .xinitrc is simply: > > exec ck-launch-session startxfce4 > > if i start X as root things work in a more or less satisfactory way: pen > drives appear on the side bar on thunar and i can mount and eject them > (not umount). > > but if i start X as a normal user, i get a "not authorized" message from > thunar and i can't mount the devices. > > now, i belong to just about every group out there: > > root disk lp wheel audio cdrom video cdrw usb users lpadmin portage > plugdev lj vboxusers scanner > > any ideas why i don't have permissions to mount the usb drives? > (also, after doing these changes i can't shutdown or reboot form xfce) > > anyway, it seems i'm getting closer... a big thank you to all that have > been following this thread, i hope i'll be able to resolve this last > issue... If it involved PolicyKit, that may be the cause. Look in /etc/PolicyKit/PolicyKit.conf and see if that is blocking your access. I had to add/modify mine to allow user mounts. This is the relevent section I had to change: -- Reverend Paul Colquhoun, ULC.http://andor.dropbear.id.au/~paulcol Before you criticize someone, you should walk a mile in their shoes. Then, when you do, you'll be a mile away, and you'll have their shoes.
Re: [gentoo-user] Re: automounting usb drives
on 2011-02-26 at 14:44 walt wrote: >xfce4-session also recognizes the policykit and consolekit USE flag, and >those two things seem to be the way of the future (until tomorrow, anyway) >for desktop managers like kde and gnome. > >xfce has always been closely related to gnome, and it still uses the gnome >USE flag, I see. I'd suggest setting the three USE flags I've mentioned >and see what happens. OK, i undid everything i had been trying and decided to try this path. i recompiled xfce4-session with policykit, consolekit and gnome. i don't have a graphical login manager, i start X with startx from the console, and my .xinitrc is simply: exec ck-launch-session startxfce4 if i start X as root things work in a more or less satisfactory way: pen drives appear on the side bar on thunar and i can mount and eject them (not umount). but if i start X as a normal user, i get a "not authorized" message from thunar and i can't mount the devices. now, i belong to just about every group out there: root disk lp wheel audio cdrom video cdrw usb users lpadmin portage plugdev lj vboxusers scanner any ideas why i don't have permissions to mount the usb drives? (also, after doing these changes i can't shutdown or reboot form xfce) anyway, it seems i'm getting closer... a big thank you to all that have been following this thread, i hope i'll be able to resolve this last issue... best, lj
[gentoo-user] Re: automounting usb drives
On 02/26/2011 03:40 AM, luis jure wrote: on 2011-02-26 at 06:00 Nikos Chantziaras wrote: Make sure you have udev enabled for your desktop environment. Or HAL, if it doesn't support udev. Then it will just work. hi nikos, the only package in xfce that has a flag for udev is xfce-base/xfce4-session and it is set. i-m afraid it doesn't just work... xfce4-session also recognizes the policykit and consolekit USE flag, and those two things seem to be the way of the future (until tomorrow, anyway) for desktop managers like kde and gnome. xfce has always been closely related to gnome, and it still uses the gnome USE flag, I see. I'd suggest setting the three USE flags I've mentioned and see what happens.
[gentoo-user] Re: automounting usb drives
On 02/26/2011 05:09 PM, luis jure wrote: on 2011-02-26 at 16:53 Nikos Chantziaras wrote: Do you have any entries for those devices in /etc/fstab? If yes, delete them. They interfere with automounting. i had already deleted them, only after doing so the device icon began to appear on thunar. but i can't mount it as a normal user, only as root. Another shot: Make sure your user belongs to these groups: disk usb plugdev
Re: [gentoo-user] Re: automounting usb drives
on 2011-02-26 at 16:53 Nikos Chantziaras wrote: >Do you have any entries for those devices in /etc/fstab? If yes, delete >them. They interfere with automounting. i had already deleted them, only after doing so the device icon began to appear on thunar. but i can't mount it as a normal user, only as root.
[gentoo-user] Re: automounting usb drives
On 02/26/2011 04:46 PM, luis jure wrote: on 2011-02-26 at 11:30 luis jure wrote: i had already installed this plugin, but it doesn't seem to do much: an icon for the device appears on the side panel, but no corresponding mount point is created under /media. when i click on the icon a "Not Authorized" message appears. i'm getting somewhat closer, it seems. launching an xfce session as root i can sure mount the device, but not as normal user. from thunar i get the message above, and typing udiskie on a console, i get this: failed to mount device /org/freedesktop/UDisks/devices/sdc1: org.freedesktop.UDisks.Error.PermissionDenied: Not Authorized h any hints? Do you have any entries for those devices in /etc/fstab? If yes, delete them. They interfere with automounting.
Re: [gentoo-user] Re: automounting usb drives
on 2011-02-26 at 06:00 Nikos Chantziaras wrote: >Make sure you have udev enabled for your desktop environment. Or HAL, >if it doesn't support udev. Then it will just work. hi nikos, the only package in xfce that has a flag for udev is xfce-base/xfce4-session and it is set. i-m afraid it doesn't just work...