1

systemd-suspend.service man page:

Note that scripts or binaries dropped in /lib/systemd/system-sleep/ are intended for local use only and should be considered hacks. If applications want to be notified of system suspend/hibernation and resume, there are much nicer interfaces available.

So what are some of these "nicer interfaces" that I can use to get notified before suspension? (would be nice if it is before n sec/min)

1

1 Answer 1

0

"Nicer interfaces" is probably referring to the Inhibitor Locks implemented in systemd-logind.service, which includes a logic to inhibit system shutdowns and sleep states.

From man systemd-logind.service:

DESCRIPTION

systemd-logind is a system service that manages user logins. It is responsible for:

  • ...
  • Implementing a shutdown/sleep inhibition logic for applications

...

For more information on the inhibition logic see the Inhibitor Lock Developer Documentation.

Another solution that I can think of is to write a systemd service, see https://www.freedesktop.org/software/systemd/man/systemd.unit.html and this related question for example.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.