Il 29/12/2023 02:53, Max Nikulin ha scritto:
systemd-sleep(8) does not mention /etc/systemd/system-sleep/
I am a bit puzzled by the following:
https://www.freedesktop.org/software/systemd/man/latest/systemd-sleep.html
Note that scripts or binaries dropped in /usr/lib/systemd/system-sleep/
are intended for local use only and should be considered hacks. If
applications want to react to system suspend/hibernation and resume,
they should rather use the Inhibitor interface.
https://www.freedesktop.org/wiki/Software/systemd/inhibit/
From my point of view dealing with D-Bus just to unload a kernel module
is inconvenient. It is not an application that is started before suspend
and should be running after resume. I am curious what is the recommended
way for this particular use case.
It seems to me something that should be done from an application.
For example, in my case kaffeine could: stop dvb stream, unload module,
and inverse actions after resume.
But it wouldn't help: it would work only if kaffeine is open.
This kernel module is unable to be suspended and resumed regardless of
applications.