xyb3rt / physlock

Lightweight linux console locking tool
GNU General Public License v2.0
303 stars 36 forks source link

Running physlock fails with message: /dev/tty-1: No such file or directory #109

Closed wizeman closed 3 years ago

wizeman commented 3 years ago

Pretty much what the title says...

This is my first time trying physlock and it seemed to be working fine but now when I run physlock this is what happens:

$ physlock
physlock: /dev/tty-1: No such file or directory

This also happens when running with -d, -s and/or -p.

Also, I just noticed that for some reason, there are dozens of physlock processes already running in the background even though the screen is unlocked!

When I switch to another virtual terminal, it asks me for the root password. But then the screen is unlocked again and there are still dozens of other physlock processes running...

wizeman commented 3 years ago

It seems that this is triggered by me pressing Alt+K Sway keybind to lock my screen (I've configured it to run physlock -ds). When physlock runs, it switches to another virtual terminal, but the switching causes the Alt+K keybind to remain pressed in Sway/wayland and therefore Sway runs physlock multiple times in a row.

And it seems that physlock has some kind of race condition where if you run it multiple times in a short sequence, one of the processes runs, but the others get stuck... and when the screen gets unlocked, then subsequent attempts to run physlock will fail, likely because of the other physlock processes still running in the background (even though the screen is unlocked at that point).

wizeman commented 3 years ago

Duplicate of #93