FS#12221 - [policykit] hal, removable devices not automounted
Attached to Project:
Arch Linux
Opened by Filip Wojciechowski (fwojciec) - Monday, 24 November 2008, 02:12 GMT
Last edited by Jan de Groot (JGC) - Sunday, 08 November 2009, 22:25 GMT
Opened by Filip Wojciechowski (fwojciec) - Monday, 24 November 2008, 02:12 GMT
Last edited by Jan de Groot (JGC) - Sunday, 08 November 2009, 22:25 GMT
|
Details
Description:
After upgrading to policykit 0.9-6 and hal 0.5.11-7 no removable devices (usb sticks, CDs, DVDs) are mounted automatically. Trying to mount them using hal results in the following error message: "org.freedesktop.hal.storage.mount-removable no <-- (action, result)." I was able to find a workaround that got things working as they should; the workaround involves adding something like this: <match action="org.freedesktop.halstorage.mount-removable"> <return result="yes"> </match> to /etc/PolicyKit/PolicyKit.conf This is the webpage I found this suggestion: http://www.nabble.com/Can%27t-automount-without-being-root-td16358029.html The problem is currently i686 only, since these versions of policykit and hal seem to have not been built yet for x86_64. Please let me know if I can provide any further debugging info. Additional info: * package version(s) policiykit 0.9-6 hal 0.5.11-7 Steps to reproduce: Upgrade to the above-mentioned versions of hal and policykit packages. Restart hal (not sure if this is necessary); if there is a removable device inserted remove it, and insert it back. Try to mount the device using hal. |
This task depends upon
Closed by Jan de Groot (JGC)
Sunday, 08 November 2009, 22:25 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 0.5.13-3 (testing)
Sunday, 08 November 2009, 22:25 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 0.5.13-3 (testing)
I needed to add another workaround (analogous to the one described above) for "org.freedesktop.hal.storage.eject" as well, since ejecting devices didn't work either.
"session required pam_ck_connector.so" to the /etc/pam.d/login file, but this doesn't seem to be making any difference (I restarted after making the change).
If I use GDM to log in everything works fine.
If I login using my usual method (autologin my user to vc/1 using mingetty then X is started from ~/.bash_profile) -- it doesn't.
So is this whole new policykit/consolekit thing only going to work correctly when using a login manager?
Any suggestions for a reasonable workaround given a setup like mine (without a login manager)?
1) Add "session optional pam_ck_connector.so" to /etc/pam.d/login
2) Every session started from .xinitrc must have ck-launch-session pre-appended, like so:
exec ck-launch-session openbox-session
or exec ck-launch-session start-wmii.sh
When all this is done the permissions seem to work as they should.
testing/hal 0.5.11-7
extra/dbus 1.2.4-1
extra/policykit 0.9-7
1) pam_ck_connector doesn't work in /etc/pam.d/kde: it opens a session, but sets active=FALSE (see ck-list-sessions)
2) If I use .xsession and launch "exec ck-launch-session startkde", everything works, but this should only be used in combination with startx, not with a login manager
3) If I patch kdebase-workspace with http://bugs.kde.org/attachment.cgi?id=28418, everything works out of the box (should also work when launching somethinge else than kde from kdm). This is already supported in upstream kde 4.2
This should be the way to go:
1) Fix all login managers to launch a consolekit session
2) For sessions launched from xinitrc/startx, use ck-launch-session
3) Maybe fix pam_ck_connector to be less braindead
I hate this little critter :)
2) You need to login again using kdm with the patched package. Make sure you actually relaunch kdm after the update, not just log out and log in (which won't necessarily relaunch it). If you don't use kdm, but rather startx, you need to have 'ck-launch-session startkde' instead of 'startkde' in .xinitrc.
I didn't try Pierre's new package yet, but the one I built for myself is working great.
@JGC: Is it possible to disable consolekit in hal until it is really working. (especially the pam module)
I think fixing the pam module should have the highest priority.
As for the pam module: Allan and I have been debugging it a bit for slim yesterday. Somehow the pam module makes some wrong assumptions, either by bugs in the pam module or by bugs in slim (why would you set RHOST to localhost while doing a local login, that's a bug in slim).
I will do some further bughunting on this pam module this weekend, hope we can get this thing working correctly.
As for disabling policykit in hal: this package is in testing and works as long as consolekit works with your login manager or way to start your session. This package will stay in testing as long as we haven't integrated consolekit correctly. I won't revert anything and I won't add weird policykit configuration files to the extra version of hal or policykit to fix bugs we have open in gnome-power-manager at this moment.
@JGC: There is a patched version of kdebase-workspace in testing which should work with consolekit. I didn't try that version, but I think Pierre used the same patch as I did locally. I am unsure why it wouldn't work for Jada, but he doesn't give too much information.
@Jada: Are you even using kdm? If not, the new kdebase-workspace from testing won't change anything for you.
I overlook your comment, sorry.
Yes, it works.
@ brain0: Yes I am using kdm "inittab" but I am going to change it. I will try it out using KDM "rc.conf Daemon". More about it later today!
So only other login managers are affected by this?
If it doesn't work for you, run ck-list-sessions and paste your output here.
Reason, drive don't unmount, no write access, I am done with it now. Does it really have to so bloody that I never get my travel drive working. I know it is not all your fault guys, .........
Thank's to Pierre, Jan, Thomas, Tobias,
FYI, I'm done repeating myself.
auth required pam_securetty.so
auth requisite pam_nologin.so
auth required pam_unix.so nullok
auth required pam_tally.so onerr=succeed file=/var/log/faillog
# use this to lockout accounts for 10 minutes after 3 failed attempts
#auth required pam_tally.so deny=2 unlock_time=600 onerr=succeed file=/var/log/faillog
account required pam_access.so
account required pam_time.so
account required pam_unix.so
#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
#password required pam_unix.so md5 shadow use_authtok
session required pam_unix.so
session required pam_env.so
session required pam_motd.so
session required pam_limits.so
session optional pam_mail.so dir=/var/spool/mail standard
session optional pam_lastlog.so
So apparently, that doesn't work for you, but none of us can reproduce that (for any of us it works as soon as we use the new kdm). Jan, do you know how to debug this? Is there some option that forces consolekit to be verbose to the syslog?
Session1:
unix-user = '1000'
realname = ',,,'
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2008-12-06T11:32:35.768809Z'
login-session-id = ''
"org.freedesktop.Hal.Device.PermitionDeniedByPolicy: org.freedesktop.hal.storage.mount-removable no <-- (action, result)"
"polkit-action --action org.freedesktop.hal.storage.mount-removable" lists the current values
"polkit-action --reset-defaults org.freedesktop.hal.storage.mount-removable" resets the defaults
error is:
"org.freedesktop.Hal.Device.PermitionDeniedByPolicy: org.freedesktop.hal.storage.mount-removable no <-- (action, result)"
[root@Apollon PolicyKit]# ck-list-sessions
Session1:
unix-user = '1000'
realname = 'Damir Perisa,,,'
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2008-12-06T13:25:35.637631Z'
login-session-id = ''
[root@Apollon PolicyKit]# polkit-action --action org.freedesktop.hal.storage.mount-removable
action_id: org.freedesktop.hal.storage.mount-removable
description: Mount file systems from removable drives.
message: System policy prevents mounting removable media
default_any: no
default_inactive: no
default_active: yes
[root@Apollon PolicyKit]# polkit-action --reset-defaults org.freedesktop.hal.storage.mount-removable
[root@Apollon PolicyKit]# polkit-action --action org.freedesktop.hal.storage.mount-removable
action_id: org.freedesktop.hal.storage.mount-removable
description: Mount file systems from removable drives.
message: System policy prevents mounting removable media
default_any: no
default_inactive: no
default_active: yes
kdm is started out of rc.conf DAEMONS
From what I can see, my output is the same as Damir's. But I start kdm from inittab (shouldn't make a difference though).
[jada@computer-01 ~]$ ck-list-sessions
Session1:
unix-user = '1000'
realname = ''
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2008-12-07T07:23:01.507758Z'
login-session-id = ''
[jada@computer-01 ~]$
It doesn't fix my problem with my USB-Travel Drive. I can't cope from the computer to the drive. But I can open all stuff on the drive and copy to the computer.
More bad, I am going to sync my MP3 Sony Walkman by using Amarok. Amarok see it and play the music. After remove the Player from the USB Port all Music files on the Player are destroid. In fact the permission is over written to "root"! No User can use this player. More bad, I have to format the MP3 Player, load Windows and load a new Firmware and Copy all MP3 from my Windows Backup Server to the Player.
I warning all how read this. In this development status, becareful with the KDE4 Desktop.
Cannot find policy file entry for action id 'org.freedesktop.hal.storage.mount-removable'
bash-3.2#
Try reinstalling policykit or ask in the forum.
And BTW, KDE 4 has nothing to do with how filesystems are accessed. It is not in an early development state and does not destroy filesystems. You might want to run 'mount' while the drive is mounted to see how exactly it is mounted, and run ls -lF on the mount point. What you are telling us doesn't make ANY sense to me, nothing fits together, so I guess you did more than you should do, trying to fix things that are not broken.
EDIT: And by the way: Reinstalling the system NEVER fixes anything, it is simply a waste of time.
(pcmanfm:4433): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 1 char 53: '-' is not a valid character following a '<' character; it may not begin an element name
So, the error is not helpful since it can't be properly displayed.
This does not work for my usb camera or my usb stick.
Installed files:
]$ pacman -Qi hal policykit consolekit
Name : hal
Version : 0.5.11-7
URL : http://www.freedesktop.org/wiki/Software/hal
Licenses : GPL custom
Groups : None
Provides : None
Depends On : dbus-glib>=0.76 dbus>=1.2.4 libusb>=0.1.12 udev>=118
filesystem>=0.7.1-5 hal-info>=0.20081022 eject
libsmbios>=2.0.2 dmidecode pciutils>=3.0.2
usbutils>=0.73-5 pm-utils>=1.2.2.1 policykit>=0.9-6
consolekit>=0.3.0
Optional Deps : None
Required By : gnome-vfs pcmanfm xorg-server
Conflicts With : None
Replaces : None
Installed Size : 2448.00 K
Packager : Jan de Groot <jgc@archlinux.org>
Architecture : x86_64
Build Date : Sun 30 Nov 2008 11:51:24 AM EST
Install Date : Sun 07 Dec 2008 11:05:03 PM EST
Install Reason : Explicitly installed
Install Script : Yes
Description : Hardware Abstraction Layer
Name : policykit
Version : 0.9-7
URL : http://hal.freedesktop.org/docs/PolicyKit/
Licenses : custom
Groups : None
Provides : None
Depends On : dbus-glib>=0.76 expat>=2.0.1 pam
Optional Deps : None
Required By : consolekit gconf hal
Conflicts With : None
Replaces : None
Installed Size : 1980.00 K
Packager : Jan de Groot <jgc@archlinux.org>
Architecture : x86_64
Build Date : Sun 30 Nov 2008 09:43:40 AM EST
Install Date : Wed 03 Dec 2008 11:35:27 AM EST
Install Reason : Installed as a dependency for another package
Install Script : Yes
Description : Application development toolkit for controlling system-wide
privileges
Name : consolekit
Version : 0.3.0-3
URL : http://www.freedesktop.org/wiki/Software/ConsoleKit
Licenses : GPL
Groups : None
Provides : None
Depends On : dbus-glib>=0.76 glib2>=2.18.2 policykit>=0.9 zlib
Optional Deps : None
Required By : hal
Conflicts With : None
Replaces : None
Installed Size : 532.00 K
Packager : Jan de Groot <jgc@archlinux.org>
Architecture : x86_64
Build Date : Sun 30 Nov 2008 11:48:52 AM EST
Install Date : Wed 03 Dec 2008 11:35:27 AM EST
Install Reason : Installed as a dependency for another package
Install Script : No
Description : A framework for defining and tracking users, login sessions,
and seats
Anyway, my ck-list-sessions is as follows:
$ ck-list-sessions
Session1:
unix-user = '1000'
realname = ',,,'
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2008-12-08T04:21:26.905733Z'
login-session-id = ''
my .xinitrc file:
$ cat .xinitrc
#! bin/bash
numlockx &
sh ~/.fehbg &
touch .Xauthority
pypanel &
#exec startxfce4
#exec startlxde
exec ck-launch-session openbox-session
polkit:
$ polkit-action --action org.freedesktop.hal.storage.mount-removable
action_id: org.freedesktop.hal.storage.mount-removable
description: Mount file systems from removable drives.
message: System policy prevents mounting removable media
default_any: no
default_inactive: no
default_active: yes
Rset does nothing
Anything else you want me to look into?
Partition and usb devices are all working as `mount` works just fine.
lines:
<match action="org.freedesktop.hal.storage.mount-removable">
<return result="yes" />
</match>
<match action="org.freedesktop.hal.storage.eject-removable">
<return result="yes" />
</match>
and now i am able to mount and eject removable drives.
[damir@Apollon ~]$
no
This is really disappointing and the first major frustration I've had with Arch in the three years that I've been using it. Anyone have a good workaround that will allow me to mount and use things that I want to use without having to look up the HAL actions and add to PolicyKit, destroy session and/or reboot each time, and hope it works? This is terrible and sad. : (
<match action="org.freedesktop.hal.storage.mount-fixed">
<return result="yes"/>
</match>
<match action="hal-storage-mount-fixed-extra-options">
<return result="yes"/>
</match>
<match action="hal-storage-mount-removable-extra-options">
<return result="yes"/>
</match>
The hal-storage-mount-*-extra-options actions aren't likely to stick around for long but I thought I would document what I needed to do in case someone else stumbles across this bug report with the same problems.
<match action="org.freedesktop.hal.storage.mount-removable">
<return result="yes" />
</match>
<match action="org.freedesktop.hal.storage.eject-removable">
<return result="yes" />
</match>
http://bugs.archlinux.org/task/13163?string=hal&project=1&search_name=&type[0]=&sev[0]=&pri[0]=&due[0]=&reported[0]=&cat[0]=&status[0]=open&percent[0]=&opened=&dev=&closed=&duedatefrom=&duedateto=&changedfrom=&changedto=&openedfrom=&openedto=&closedfrom=&closedto=
http://bbs.archlinux.org/viewtopic.php?id=65070