[oS-en] Is it possible to trigger some job when hibernation fails?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yesterday night I told the machine to hibernate and left the room. This morning I came back and found the machine running, using electricity. Hibernation had failed, reason not clear. It is not the first time. I don't care for the reason, usually a second try succeeds. But I have to notice. Waiting is not it, sometimes hibernation just takes long to complete. I want to know when it failed. The log does show it failed. What I want is to trigger some script when it fails. The script will tell me, somehow, like ringing a bell. How do I launch that script? Long ago we decided there was no way to do it. Is there now some way? To hibernate, I do, as root: sudo /usr/bin/systemctl hibernate which always return before completing. If you are curious, the reason this time was: <0.6> 2022-03-02T03:38:30.405121+01:00 Telcontar kernel - - - [260032.789235] PM: hibernation: Creating image: <0.6> 2022-03-02T03:38:30.405125+01:00 Telcontar kernel - - - [260033.285989] PM: hibernation: Need to copy 4387369 pages <0.7> 2022-03-02T03:38:30.405125+01:00 Telcontar kernel - - - [260033.285992] PM: hibernation: Normal pages needed: 4387369 + 1024, available pages: 3988067 <0.3> 2022-03-02T03:38:30.405128+01:00 Telcontar kernel - - - [260033.285993] PM: hibernation: Not enough free memory <0.3> 2022-03-02T03:38:30.405128+01:00 Telcontar kernel - - - [260032.789427] PM: hibernation: Error -12 creating image ... <3.3> 2022-03-02T03:38:30.497553+01:00 Telcontar systemd-sleep 15519 - - Failed to suspend system. System resumed again: Cannot allocate memory (machine has 32 gigs or ram, and 12719480 KiB are free now) The previous time was: <0.7> 2022-02-28T04:28:03.533764+01:00 Telcontar kernel - - - [159266.987264] PM: hibernation: Basic memory bitmaps created <0.6> 2022-02-28T04:28:03.533764+01:00 Telcontar kernel - - - [159266.987344] PM: hibernation: Preallocating image memory <0.6> 2022-02-28T04:28:03.533765+01:00 Telcontar kernel - - - [159276.443763] PM: hibernation: Allocated 2557543 pages for shapshot <0.6> 2022-02-28T04:28:03.533766+01:00 Telcontar kernel - - - [159276.443766] PM: hibernation: Allocated 10230172 kbytes in 9.45 seconds (1082.55 MB/s) <0.6> 2022-02-28T04:28:03.533766+01:00 Telcontar kernel - - - [159276.443766] Freezing remaining freezable tasks ... <0.3> 2022-02-28T04:28:03.533767+01:00 Telcontar kernel - - - [159296.449068] Freezing of tasks failed after 20.005 seconds (0 tasks refusing to freeze, wq_busy=1): ... <3.3> 2022-02-28T04:28:03.673259+01:00 Telcontar systemd-sleep 2417 - - Failed to suspend system. System resumed again: Device or resource busy Before that, this one: Jan 31 03:15:04 Telcontar kernel: PM: hibernation: Preallocating image memory Jan 31 03:15:04 Telcontar kernel: PM: hibernation: Allocated 2465214 pages for shapshot Jan 31 03:15:04 Telcontar kernel: PM: hibernation: Allocated 9860856 kbytes in 32.60 seconds (302.48 MB/s) Jan 31 03:15:04 Telcontar kernel: Freezing remaining freezable tasks ... Jan 31 03:15:04 Telcontar kernel: Freezing of tasks failed after 20.003 seconds (0 tasks refusing to freeze, wq_busy=1): ... Jan 31 03:15:04 Telcontar systemd-sleep[22294]: Failed to suspend system. System resumed again: Device or resource busy (and then, some xfs related messages) No more instances in the journal, which goes back to Nov 19. Anyway, you see, hibernation is not reliable. I need a way to run a job when this happens. - -- Cheers Carlos E. R. (from 15.3 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYh9UTRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV6pMAn0O6GtFEj6nf9PM43VLi nW3yR8AhAJ98DkrGr6ej8Q9mxVpWUJ7P/qmurg== =jRKQ -----END PGP SIGNATURE-----
participants (4)
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Howorth
-
Parodper