Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] KDE Plasma 5 - problem with mount - polkit?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sat Feb 13, 2016 9:01 pm    Post subject: [SOLVED] KDE Plasma 5 - problem with mount - polkit? Reply with quote

Hi,

After an update into Plasma 5 I cannot mount eg. sd-card in my card reader
Quote:
Could not mount the following device...

before that I had a question for a root password and I could use it.

5 years ago I had similair problem and the sollution was to manually set the file:
Code:
/usr/share/polkit-1/actions/org.freedesktop.udisks.policy


Before I will do the same I have a question - is it possible to fix it in different way?


Last edited by Xywa on Tue May 31, 2016 10:58 am; edited 1 time in total
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Sat Feb 13, 2016 9:03 pm    Post subject: Reply with quote

Please check your consolekit setup. Please check if you are part of the users group.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sun Feb 14, 2016 5:54 am    Post subject: Reply with quote

genstorm wrote:
Please check your consolekit setup. Please check if you are part of the users group.


I am part of users group and I have consolekit:
Code:
# equery u consolekit
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-auth/consolekit-1.0.1:
 U I
 + + acl      : Add support for Access Control Lists
 - - cgroups  : Use the kernel to track processes instead of the session cookie.
 - - debug    : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
                https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - doc      : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 + + pam      : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
 - - pm-utils : Adds support for suspend/resume using sys-power/pm-utils
 - - test     : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it
                in make.conf/package.use anymore


Maybe somewhere in KDE System Settings >> Device Actions?
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Sun Feb 14, 2016 10:05 am    Post subject: Reply with quote

Check your consolekit setup ;)

https://wiki.gentoo.org/wiki/ConsoleKit#Troubleshooting

Code:
$ ck-list-sessions
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sun Feb 14, 2016 2:27 pm    Post subject: Reply with quote

genstorm wrote:
Check your consolekit setup ;)

https://wiki.gentoo.org/wiki/ConsoleKit#Troubleshooting

Code:
$ ck-list-sessions


active = FALSE in my case, but what does it mean? And why this used to work in KDE4?

Code:
$ ck-list-sessions
Session1:
        unix-user = '500'
        realname = '(null)'
        seat = 'Seat1'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = '/dev/tty1'
        remote-host-name = ''
        is-local = TRUE
        on-since = '2016-02-14T05:38:40.438954Z'
        login-session-id = '2'
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Sun Feb 14, 2016 2:36 pm    Post subject: Reply with quote

Yep, that's bad. It might be unrelated to KDE? ;)

What are your use flags for sddm?

Please check your system-login file: https://wiki.gentoo.org/wiki/KDE/Plasma_5_upgrade#Missing_shutdown.2C_reboot.2C_suspend_and_hibernate_buttons_when_using_OpenRC
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sun Feb 14, 2016 4:32 pm    Post subject: Reply with quote

genstorm wrote:
Yep, that's bad. It might be unrelated to KDE? ;)

What are your use flags for sddm?

Please check your system-login file: https://wiki.gentoo.org/wiki/KDE/Plasma_5_upgrade#Missing_shutdown.2C_reboot.2C_suspend_and_hibernate_buttons_when_using_OpenRC


What I have:
Code:
$ grep pam_ck_connector /etc/pam.d/system-login
session         optional        pam_ck_connector.so nox11


Code:
*  kde-plasma/powerdevil
      Latest version available: 5.5.4
      Latest version installed: 5.5.4

Code:
*  sys-power/upower-pm-utils
      Latest version available: 0.9.23-r2
      Latest version installed: 0.9.23-r2

Code:
*  sys-power/upower
      Latest version available: 0.99.3
      Latest version installed: 0.99.3

Code:
*  x11-misc/sddm
      Latest version available: 0.13.0-r1
      Latest version installed: 0.13.0-r1

Code:
# equery u sddm
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for x11-misc/sddm-0.13.0-r1:
 U I
 + + consolekit : Use ck-launch-session from sys-auth/consolekit by default in Xsession (no native support)
 + + pam        : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
 - - systemd    : Enable use of systemd-specific libraries and features like socket activation or session tracking


And sddm in video group.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Sun Feb 14, 2016 5:49 pm    Post subject: Reply with quote

Xywa wrote:
Code:
*  sys-power/upower-pm-utils
      Latest version available: 0.9.23-r2
      Latest version installed: 0.9.23-r2

Code:
*  sys-power/upower
      Latest version available: 0.99.3
      Latest version installed: 0.99.3

How exactly did that happen? upower and upower-pm-utils block each other.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Mon Feb 15, 2016 12:41 am    Post subject: Reply with quote

genstorm wrote:
Xywa wrote:
Code:
*  sys-power/upower-pm-utils
      Latest version available: 0.9.23-r2
      Latest version installed: 0.9.23-r2

Code:
*  sys-power/upower
      Latest version available: 0.99.3
      Latest version installed: 0.99.3

How exactly did that happen? upower and upower-pm-utils block each other.


I was missing sys-power/upower-pm-utils when I was writing this, so I thought it is necessary...
Just realized is OR not AND:
Quote:
Please ensure that kde-plasma/powerdevil and sys-power/upower-pm-utils or sys-power/upower are installed. Also ensure that your user belongs to the users group.


p.s. I can see now some of the rules form
Code:
/usr/share/polkit-1/actions/org.freedesktop.udisks.policy

are here:
Code:
/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy


Maybe Palsma 5 do not use udisk2.policy only udisk.policy?

Code:
# equery u polkit
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-auth/polkit-0.113-r1:
 U I
 - - examples      : Install examples, usually source code
 + + gtk           : Add support for x11-libs/gtk+ (The GIMP Toolkit)
 + + introspection : Add support for GObject based introspection
 - - jit           : Enable just-in-time compilation for improved performance. May prevent use of some PaX memory protection features
                     in Gentoo Hardened.
 + + kde           : Add support for KDE (K Desktop Environment)
 + + nls           : Add Native Language Support (using gettext - GNU locale utilities)
 + + pam           : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
 - - systemd       : Use sys-apps/systemd instead of sys-auth/consolekit for session tracking
 - - test          : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't
                     set it in make.conf/package.use anymore


Code:
$ pkaction --verbose --action-id org.freedesktop.udisks2.filesystem-mount
org.freedesktop.udisks2.filesystem-mount:
  description:       Mount a filesystem
  message:           Authentication is required to mount the filesystem
  vendor:            The udisks Project
  vendor_url:        http://udisks.freedesktop.org/
  icon:              drive-removable-media
  implicit any:      auth_admin
  implicit inactive: auth_admin
  implicit active:   yes


or maybe this?
Code:
>>> Installing (1 of 1) sys-auth/polkit-0.113-r1::gentoo
 * >>> SetUID: [chmod go-r] /usr/bin/pkexec ...                                                                                  [ ok ]
 * >>> SetUID: [chmod go-r] /usr/lib/polkit-1/polkit-agent-helper-1 ...                                                          [ ok ]

 * Messages for package sys-auth/polkit-0.113-r1:

 * Failed to set XATTR_PAX markings -mre test/polkitbackend/.libs/polkitbackendjsauthoritytest.
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 832
Location: Cape Town, South Africa

PostPosted: Thu Apr 28, 2016 10:47 am    Post subject: Reply with quote

Did you get this working? I'm also sitting with same problem of "could not mount" USB memory sticks after upgrading to Plasma 5.

Thanks, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
Pistos
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 175
Location: Canada

PostPosted: Mon May 02, 2016 7:58 pm    Post subject: Reply with quote

+1, Bump, etc.

I, too, can't mount USB sticks from Plasma (after upgrading from KDE 4). Mounting as root with the `mount` command isn't a problem, but it would be nicer to be able to "just mount" from Plasma/KDE 5 when the Device Notifier comes up after plugging it in.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Mon May 02, 2016 8:04 pm    Post subject: Reply with quote

Did you follow Gentoo's upgrade guide for Plasma-5? Had a look in its troubleshooting section already? Check any of those things above?
Back to top
View user's profile Send private message
Pistos
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 175
Location: Canada

PostPosted: Mon May 02, 2016 8:26 pm    Post subject: Reply with quote

I've looked over both of:

* https://wiki.gentoo.org/wiki/KDE/Plasma_5_upgrade
* https://wiki.gentoo.org/wiki/ConsoleKit#Troubleshooting

and to my knowledge, I've followed whatever steps and changes seemed necessary. I am fully up-to-date as far as `emerge -uatvDN world` and `emerge --depclean` are concerned.

I'm using sddm, so I didn't think the `startx` related stuff on those docs applied.

/var/log/messages and dmesg are silent while I try to mount from the Plasma device notifier.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Mon May 02, 2016 8:31 pm    Post subject: Reply with quote

Code:
$ ck-list-sessions
$ grep pam_ck_connector /etc/pam.d/system-login
Back to top
View user's profile Send private message
Pistos
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 175
Location: Canada

PostPosted: Mon May 02, 2016 8:47 pm    Post subject: Reply with quote

Code:
# as non-root user logged into Plasma:
% ck-list-sessions
Session2:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat1'
        session-type = ''
        active = TRUE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = TRUE
        on-since = '2016-05-02T15:03:48.437616Z'
        login-session-id = '4'

# as root:

# grep pam_ck_connector /etc/pam.d/system-login
session         optional        pam_ck_connector.so nox11


Oh, and my user is in the plugdev group already.
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 832
Location: Cape Town, South Africa

PostPosted: Mon May 02, 2016 9:20 pm    Post subject: Reply with quote

All as user.

~ $ ck-list-sessions
Session1:
unix-user = '1000'
realname = 'Ian'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty1'
remote-host-name = ''
is-local = TRUE
on-since = '2016-04-23T15:42:21.331345Z'
login-session-id = '3'
Session2:
unix-user = '1000'
realname = 'Ian'
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = '/dev/tty1'
remote-host-name = ''
is-local = TRUE
on-since = '2016-04-23T15:42:27.582200Z'
login-session-id = '3'

I don't know why there are two ... I found other people with this problem had the same situation (google search previously).

~ $ grep pam_ck_connector /etc/pam.d/system-login
session optional pam_ck_connector.so nox11

Thanks, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 832
Location: Cape Town, South Africa

PostPosted: Mon May 02, 2016 9:26 pm    Post subject: Reply with quote

Pistos wrote:

Oh, and my user is in the plugdev group already.


Mmm I wasn't ... but it worked before on KDE 4.....

Cheers, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
Pistos
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 175
Location: Canada

PostPosted: Mon May 02, 2016 9:30 pm    Post subject: Reply with quote

More possibly helpful info:

Code:
% udisksctl monitor
Monitoring the udisks daemon. Press Ctrl+C to exit.
16:30:39.988: The udisks-daemon is running (name-owner :1.9).
16:30:45.640: Added /org/freedesktop/UDisks2/block_devices/sdg
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdg
    DeviceNumber:               2144
    Drive:                      '/org/freedesktop/UDisks2/drives/SanDisk_Ultra_4C530001121202101372'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         
    IdLabel:                   
    IdType:                     
    IdUUID:                     
    IdUsage:                   
    IdVersion:                 
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdg
    ReadOnly:                   false
    Size:                       31306285056
    Symlinks:                   /dev/disk/by-id/usb-SanDisk_Ultra_4C530001121202101372-0:0
                                /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.4:1.0-scsi-0:0:0:0
  org.freedesktop.UDisks2.PartitionTable:
    Type:               dos
16:30:45.641: /org/freedesktop/UDisks2/drives/SanDisk_Ultra_4C530001121202101372: org.freedesktop.UDisks2.Drive: Properties Changed
  TimeMediaDetected:            1462224645637919
  MediaAvailable:               true
  Size:                         31306285056
16:30:45.709: Added /org/freedesktop/UDisks2/block_devices/sdg1
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdg1
    DeviceNumber:               2145
    Drive:                      '/org/freedesktop/UDisks2/drives/SanDisk_Ultra_4C530001121202101372'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         by-uuid-C0DF-54F7
    IdLabel:                   
    IdType:                     vfat
    IdUUID:                     C0DF-54F7
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdg1
    ReadOnly:                   false
    Size:                       31306252288
    Symlinks:                   /dev/disk/by-id/usb-SanDisk_Ultra_4C530001121202101372-0:0-part1
                                /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.4:1.0-scsi-0:0:0:0-part1
                                /dev/disk/by-uuid/C0DF-54F7
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:       
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             32768
    Size:               31306252288
    Table:              '/org/freedesktop/UDisks2/block_devices/sdg'
    Type:               0x0c
    UUID:

% udisksctl mount -b /dev/sdg1   
==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount ===
Authentication is required to mount SanDisk Ultra (/dev/sdg1)
Authenticating as: root
Password: [NOTHING TYPE HERE, I JUST PRESSED ENTER]
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Error mounting /dev/sdg1: GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized to perform operation
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Mon May 02, 2016 9:32 pm    Post subject: Reply with quote

You both are part of the 'users' group?
Back to top
View user's profile Send private message
Pistos
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 175
Location: Canada

PostPosted: Mon May 02, 2016 10:00 pm    Post subject: Reply with quote

genstorm wrote:
You both are part of the 'users' group?


I wasn't, but even after adding myself to that group, and restarting Plasma, and restarting consolkit, it doesn't make a difference.
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 832
Location: Cape Town, South Africa

PostPosted: Mon May 02, 2016 10:01 pm    Post subject: Reply with quote

genstorm wrote:
You both are part of the 'users' group?


wheel audio cdrom video games mysql cdrw usb users scanner bacula vboxusers android nginx ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 832
Location: Cape Town, South Africa

PostPosted: Mon May 02, 2016 10:41 pm    Post subject: Reply with quote

After adding myself to plugdev, I have rebooted, and tried to plug in a USB stick.

The device notifier detects it and offers to open, but when I click open, it tells me (hidden in the expandable bit at the bottom of the dialogue) that
"An unspecified error has occurred. Not authorized to perform operation."
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
sergrusso
n00b
n00b


Joined: 18 Dec 2015
Posts: 11

PostPosted: Tue May 03, 2016 12:38 am    Post subject: Reply with quote

I have the same problem

I came across this on another forum

Quote:
When the pop-up notification comes up that says a device has been
plugged in, did you click on the checkmark on that notification? If you
click the device itself, you will get "permission denied". If you click
the checkmark, it work fine.


so when I click on the check mark I get a popup that asks me for my password and then it mounts the device.

I don't know if this will help anybody.
Back to top
View user's profile Send private message
Pistos
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 175
Location: Canada

PostPosted: Tue May 03, 2016 3:08 am    Post subject: Reply with quote

I solved the problem [for my system]!

Researching on the net, I cobbled together this solution:

Create the file /etc/polkit-1/localauthority/50-local.d/55-storage.pkla (the directory tree should already exist), and put this into it:

Code:
[Storage Permissions]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks2.filesystem-mount
ResultAny=yes
ResultActive=yes
ResultInactive=no


where the value of "Action" matches the error you see when trying to manually mount with a command like:

Code:
udisksctl mount -b /dev/sdg1


Same results if you make this file instead:

Code:
# /etc/polkit-1/rules.d/10-udisks.rules

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.udisks2.filesystem-mount" && subject.isInGroup("plugdev")) {
        return "yes";
    }
});
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 832
Location: Cape Town, South Africa

PostPosted: Tue May 03, 2016 5:35 am    Post subject: Reply with quote

sergrusso wrote:
I have the same problem

I came across this on another forum

Quote:
When the pop-up notification comes up that says a device has been
plugged in, did you click on the checkmark on that notification? If you
click the device itself, you will get "permission denied". If you click
the checkmark, it work fine.


so when I click on the check mark I get a popup that asks me for my password and then it mounts the device.

I don't know if this will help anybody.


Sweet lord, what were the KDE devs thinking? This is bloody obtuse.

Confirmed working here : click the "tick", and THEN click the "device" ... it showed a small map of available space and space used on the device.
I did not get asked for my password. Possibly the whole "plugdev" thing affects that, but I never got asked in KDE4 either.

This is not a very obvious user interface change.... they should at least put a hover dialogue over the tick, and another over the rest of the field, telling what to do. And fix that useless error message.

Thanks a mill.

Cheers, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum