You are not logged in.

#1 2019-10-21 01:01:00

Vityou
Member
Registered: 2016-07-15
Posts: 36

how to make a lock service more robust

I currently have a service file that locks the screen using physlock whenever I sleep my laptop:

[Unit]
Description=Lock the screen
Before=sleep.target hibernate.target

[Service]
ExecStart=/usr/bin/physlock

[Install]
WantedBy=sleep.target hibernate.target

The problem is that if I have physlock already running and I shut my laptop, the service will run and continue to run even after I unlock the screen with the previously running physlock.  This means it doesn't run when I sleep my laptop from then on out unless I manually stop it.  Is there any way to fix this behavior?

Offline

#2 2019-10-21 01:12:45

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: how to make a lock service more robust

muennich wrote:

-d       fork and detach, parent returns after everything is set up
         (useful for suspend/hibernate scripts)
-h       print short usage help and exit
-l       only lock console switching
-L       only enable console switching
-m       mute kernel messages on console while physlock is running
-p MSG   Display MSG before the password prompt
-s       disable sysrq key while physlock is running
-v       print version information and exit

https://github.com/muennich/physlock

Offline

#3 2019-10-23 21:22:10

Vityou
Member
Registered: 2016-07-15
Posts: 36

Re: how to make a lock service more robust

I've read the man pages, and `-d` doesn't work with my service file, it just makes the screen flash black for a second and brings it back without locking.

Offline

#4 2019-10-24 07:31:57

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,711
Website

Re: how to make a lock service more robust

If you use -d you most likely need to change the systemd service to Type=forking.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

Board footer

Powered by FluxBB