Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] kde5 screenlock unlock fails after migrating system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 379
Location: Paris

PostPosted: Wed Feb 14, 2018 7:27 am    Post subject: [solved] kde5 screenlock unlock fails after migrating system Reply with quote

I can't unlock the screenlock in plasma 5 after migrating to new SSD:

I get a new SSD and I want to migrate all the files of my old hard drive to the new SSD instead of installing new system from zero. I ran the command "cp -r -p" and copied all the folders to the new SSD except for /boot, /dev, /mnt, /proc, /sys, /tmp, (I create them manually) preserving all the permissions of each folder, each file. After finishing the copy, I recreated the bootloader.
It works fine when I boot with the new SSD. However, it seems all go well except for unlocking screenlock of plasma5. it says "Authentification Failure". I start my plasma5 by startx. The password is correct, I can access my account. I can run sudo, shutdown and reboot without any problem. Unlocking the screenlock works fine in the old hard drive. Could someone tell me what I missed?

Thank you.


Last edited by pd1986 on Thu Mar 15, 2018 12:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Wed Feb 14, 2018 11:43 pm    Post subject: Reply with quote

Are you using systemd, elogind, or consolekit?

Are you able to unlock session from other terminal (Alt+Fn)?
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6449
Location: Austria

PostPosted: Wed Feb 14, 2018 11:52 pm    Post subject: Reply with quote

If you use startx, then what is in your ~/.xinitrc?
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 379
Location: Paris

PostPosted: Fri Feb 16, 2018 3:24 am    Post subject: Reply with quote

PrSo wrote:
Are you using systemd, elogind, or consolekit?

Are you able to unlock session from other terminal (Alt+Fn)?


I am using consolkit. How can I unlock session from other terminal? what is the command? Thanks
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 379
Location: Paris

PostPosted: Fri Feb 16, 2018 3:25 am    Post subject: Reply with quote

asturm wrote:
If you use startx, then what is in your ~/.xinitrc?


Code:
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session startkde


It worked before
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Fri Feb 16, 2018 11:35 am    Post subject: Reply with quote

pd1986 wrote:

I am using consolkit. How can I unlock session from other terminal? what is the command? Thanks


If I remember correctly you have to be root:

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Session1 org.freedesktop.ConsoleKit.SessionUnlock


assumig that X is on session1, to check on what session X is running:
Code:
ck-list-sessions


I took it from topic: https://forums.gentoo.org/viewtopic-t-1046566-start-0.html
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 379
Location: Paris

PostPosted: Fri Feb 16, 2018 8:51 pm    Post subject: Reply with quote

PrSo wrote:
pd1986 wrote:

I am using consolkit. How can I unlock session from other terminal? what is the command? Thanks


If I remember correctly you have to be root:

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Session1 org.freedesktop.ConsoleKit.SessionUnlock


assumig that X is on session1, to check on what session X is running:
Code:
ck-list-sessions


I took it from topic: https://forums.gentoo.org/viewtopic-t-1046566-start-0.html


it doesn't work. it says unknown method, No such interface on org.freedesktop.ConsoleKit" on object at path ......
I am sure that I ran it with right session number.
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Sun Feb 18, 2018 12:42 pm    Post subject: Reply with quote

That is really strange.

I haven't use consolekit since a year or so (I am using elogind now), but as I remember correctly this way of unlocking the session was working as expected on my machine.

I have founded full bash script to unlock session on mailing list:

http://readlist.com/lists/gentoo.org/gentoo-user/41/209925.html, which basically does the same as previously mentioned command but IMHO is worth a try.

Maybe you should try to reemerge dbus and consolekit, I think that this could resolve permission problems.

Is there anything in your xorg or session logs that could give us a clue what is going on?
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Wed Feb 21, 2018 5:39 pm    Post subject: Reply with quote

I think that we have an explanation of this situation.

Please sync portage,update, and check once again if you cannot unlock screenlocker.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aeb1aeca6ee0f499872f9f165a01aacdcc6a1a75
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6449
Location: Austria

PostPosted: Wed Feb 21, 2018 5:41 pm    Post subject: Reply with quote

No, completely unrelated.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Wed Feb 21, 2018 5:51 pm    Post subject: Reply with quote

asturm wrote:
No, completely unrelated.


Yeah, sorry. My misatke.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2225
Location: Bardowick, Germany

PostPosted: Thu Feb 22, 2018 12:39 pm    Post subject: Reply with quote

pd1986 wrote:
it says unknown method, No such interface on org.freedesktop.ConsoleKit" on object at path ......
I am sure that I ran it with right session number.
So you have latest ConsoleKit2 and dbus is actually running?
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 379
Location: Paris

PostPosted: Wed Feb 28, 2018 2:12 pm    Post subject: Reply with quote

Yamakuzure wrote:
pd1986 wrote:
it says unknown method, No such interface on org.freedesktop.ConsoleKit" on object at path ......
I am sure that I ran it with right session number.
So you have latest ConsoleKit2 and dbus is actually running?

I have checked. both are running but only consolekit 1.2.0 is installed. Right now, I disable the screenlock option so it doesn't bother me too much. If it could be solved it would be better. Thanks.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1501
Location: United Kingdom

PostPosted: Tue Mar 06, 2018 6:08 pm    Post subject: Reply with quote

Quote:
The screen locker is broken and unlocking is not possible anymore.
In order to unlock switch to a virtual terminal (e.g. Ctrl+Alt+F2), log in and execute the command:

loginctl unlock-sessions

Afterwards switch back to the running session (Ctrl+Alt+F7).

I had the above problem again just now (Gentoo Stable with plasma-meta-5.11.5, openrc-0.34.11 and consolekit-1.2.0) and the following script I launched from TTY1 successfully unlocked the X11 session on TTY7:

Code:
fitzcarraldo@clevow230ss ~ $ cat unlockKDEsession.sh
#!/bin/bash

# Screen locker broken in KDE with ConsoleKit
# See https://forums.gentoo.org/viewtopic-t-1046566.html
# and https://forums.gentoo.org/viewtopic-t-1054134.html

# Find which session is locked
session=Session$(ck-list-sessions | grep -B10 "x11-display = ':0" | grep -o -P '(?<=Session).*(?=:)')

# Create Bash script to unlock session
echo "#!/bin/bash" > /unlock.sh
echo "su -c 'dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/$session org.freedesktop.ConsoleKit.Session.Unlock'" >> /unlock.sh
chmod +x /unlock.sh

# Run Bash script in another TTY
openvt -s -w /unlock.sh

_________________
Clevo W230SS: amd64, OpenRC, nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64, OpenRC, xf86-video-ati, dual booting with Win 7 Pro 64-bit.
KDE on both laptops.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6449
Location: Austria

PostPosted: Tue Mar 06, 2018 6:12 pm    Post subject: Reply with quote

fwiw, Plasma 5.12* provides a new `ck-unlock-session` script, and in 5.13 upstream seems to have added one out of the box.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
188562
Apprentice
Apprentice


Joined: 22 Jun 2008
Posts: 186

PostPosted: Wed Mar 07, 2018 8:03 pm    Post subject: Reply with quote

Code:
su -
chown root:root /usr/lib64/libexec/kcheckpass
chmod 4755 /usr/lib64/libexec/kcheckpass


helps for my
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6449
Location: Austria

PostPosted: Wed Mar 07, 2018 8:58 pm    Post subject: Reply with quote

Don't do that.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Tue Mar 13, 2018 12:33 pm    Post subject: Reply with quote

Two days ago I was hit by this issue too. I was migrating from hdd to ssd via "rsync -av ...". After sucessfull reboot when the plasma's screenlocker triggered I was not able to unlock session by entering the correct password for my user.

In "/var/log/auth.log" I have spotted:
Code:
unix_chkpwd[2384]: check pass; user unknown
unix_chkpwd[2384]: password check failed for user (..)
kcheckpass[2365]: pam_unix(kde:auth): authentication failure; logname= uid=1000 euid=1000 tty=:0 ruser= rhost=  user=..
kcheckpass[2365]: Authentication failure for .. (invoked by uid 1000)


In my case it was something with a pam packages. Reemerging them with
Code:
emerge -1 kde-plasma/kwallet-pam sys-auth/pambase sys-libs/pam virtual/pam

and rebooting the netbook solved the problem.

I am using elogind, so I am not 100% sure if this will work for you, but IMHO it is worth a try.

BTW I still wonder what went wrong during rsync tough.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6449
Location: Austria

PostPosted: Tue Mar 13, 2018 12:40 pm    Post subject: Reply with quote

Rsync operation lost filecaps on the binary.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3580
Location: Hamburg

PostPosted: Tue Mar 13, 2018 12:41 pm    Post subject: Re: kde5 screenlock unlock fails Reply with quote

pd1986 wrote:
I ran the command "cp -r -p"
Maybe OT but I do prefer
Code:
cp -ar
.
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 120

PostPosted: Tue Mar 13, 2018 2:26 pm    Post subject: Reply with quote

asturm wrote:
Rsync operation lost filecaps on the binary.


Sorry for the OT but thank you very much astum.

Since i have that old hdd untouched I corrected my mistake (I hope so) by
Code:
cp --attributes-only -ar
on "root" partition. (as toralf suggested).
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2225
Location: Bardowick, Germany

PostPosted: Wed Mar 14, 2018 8:02 am    Post subject: Reply with quote

PrSo wrote:
I was migrating from hdd to ssd via "rsync -av ...".
That is not enough. You need at least "rsync -avHAX", or you won't get neither xattr nor ACL transported and loose all hardlinks.

And when migrating a HD with a system on it, I'd do this twice with "rsync -avHAXc" on the second run, which will check the checksums of all files.

I know this is a rather paranoid approach, but I've already lost a system by using -av only and not checking afterwards...
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 379
Location: Paris

PostPosted: Thu Mar 15, 2018 12:36 pm    Post subject: Reply with quote

PrSo wrote:
Two days ago I was hit by this issue too. I was migrating from hdd to ssd via "rsync -av ...". After sucessfull reboot when the plasma's screenlocker triggered I was not able to unlock session by entering the correct password for my user.

In "/var/log/auth.log" I have spotted:
Code:
unix_chkpwd[2384]: check pass; user unknown
unix_chkpwd[2384]: password check failed for user (..)
kcheckpass[2365]: pam_unix(kde:auth): authentication failure; logname= uid=1000 euid=1000 tty=:0 ruser= rhost=  user=..
kcheckpass[2365]: Authentication failure for .. (invoked by uid 1000)


In my case it was something with a pam packages. Reemerging them with
Code:
emerge -1 kde-plasma/kwallet-pam sys-auth/pambase sys-libs/pam virtual/pam

and rebooting the netbook solved the problem.

I am using elogind, so I am not 100% sure if this will work for you, but IMHO it is worth a try.

BTW I still wonder what went wrong during rsync tough.


It solves the problem. Thank you.
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
Page 1 of 1

 
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