Il 05/01/2024 21:24, Valerio Vanni ha scritto:
For what I've seen, the issue is that kaffeine is started in another
unit, systemd-suspend.service instead of user@1000.service.
systemd-suspend.service is deactivated after 90 seconds from resume, and
kaffeine is shut down some msec before.
And I found now that whole script cannot continue after this "takeover":
final "rm" commands are not run.
---------
2024-01-05T19:39:20.488880+01:00 newton kded5[14911]: ServiceĀ ":1.299"
unregistered
2024-01-05T19:39:20.491999+01:00 newton ksmserver[16627]: org.kde.kmix:
Could not get icon for "audio-card-analog-pci"
2024-01-05T19:39:20.494975+01:00 newton kwin_x11[14912]: qt.qpa.xcb:
QXcbConnection: XCB error: 3 (BadWindow), sequence: 18596, resource id:
134217740, major code: 15 (QueryTree), minor code: 0
2024-01-05T19:39:20.501014+01:00 newton systemd[1]:
systemd-suspend.service: Deactivated successfully.
2024-01-05T19:39:20.501146+01:00 newton systemd[1]: Finished
systemd-suspend.service - System Suspend.
2024-01-05T19:39:20.501227+01:00 newton systemd[1]:
systemd-suspend.service: Consumed 1min 10.023s CPU time.
2024-01-05T19:39:20.501296+01:00 newton systemd[1]: Stopped target
sleep.target - Sleep.
2024-01-05T19:39:20.501404+01:00 newton systemd[1]: Reached target
suspend.target - Suspend.
2024-01-05T19:39:20.501662+01:00 newton systemd[1]: Stopped target
suspend.target - Suspend.
If I use "su" method instead of "setpriv" one, kaffeine doesn't go into
systemd-suspend.service unit, and neither to user@1000.service one.
Instead, it goes to session-c2.scope. And works.
And systemd-suspend.service is finished and deactivated at the moment of
resume.
It seems that systemd-suspend.service wants to end as soon as possible,
but it cannot because it has kaffeine inside.
So it waits 90 seconds, and then terminates kaffeine.