[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-----
On Wed, 2 Mar 2022 12:26:04 +0100 (CET)
"Carlos E. R."
-----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?
Surely it's easy? You just have a script always running consuming the log. When it recognizes a failure (the text 'Failed to suspend system' seems suitable) it does whatever you want. Play a sound, send an email or a text or whatever.
To hibernate, I do, as root:
sudo /usr/bin/systemctl hibernate
which always return before completing. [snip]
O 02/03/22 ás 12:49, Dave Howorth escribiu:
On Wed, 2 Mar 2022 12:26:04 +0100 (CET) "Carlos E. R."
wrote: 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?
Surely it's easy? You just have a script always running
Instead of always running, you can try to create a systemd unit that runs after hibernate.target.
consuming the log. When it recognizes a failure (the text 'Failed to suspend system' seems suitable) it does whatever you want. Play a sound, send an email or a text or whatever.
On 2022-03-02 12:49, Dave Howorth wrote:
On Wed, 2 Mar 2022 12:26:04 +0100 (CET) "Carlos E. R." <> wrote:
...
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?
Surely it's easy? You just have a script always running consuming the log. When it recognizes a failure (the text 'Failed to suspend system' seems suitable) it does whatever you want. Play a sound, send an email or a text or whatever.
Yes, I believe rsyslogd can do that sort of thing. I have that method as "last solution" if a direct one is not possible. Reading things now: https://unix.stackexchange.com/questions/87223/rsyslog-execute-script-on-mat... I don't like this: «According to the docs, it waits for it to finish, so although it works, I imagine it causes dropped events.» https://www.rsyslog.com/doc/v8-stable/configuration/modules/omprog.html https://stackoverflow.com/questions/15396395/run-bash-command-when-specific-... https://www.reddit.com/r/linuxadmin/comments/363lxj/trigger_a_script_upon_a_... https://superuser.com/questions/1432456/how-do-i-automatically-run-a-script-... -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2022-03-02 at 12:56 +0100, Parodper wrote:
O 02/03/22 ás 12:49, Dave Howorth escribiu:
On Wed, 2 Mar 2022 12:26:04 +0100 (CET) "Carlos E. R." <> wrote:
Long ago we decided there was no way to do it. Is there now some way?
Surely it's easy? You just have a script always running
Instead of always running, you can try to create a systemd unit that runs after hibernate.target.
Maybe examine "systemctl status hibernate.target" output. cer@Telcontar:~> systemctl status hibernate.target ● hibernate.target - Hibernate Loaded: loaded (/usr/lib/systemd/system/hibernate.target; static) Active: inactive (dead) Docs: man:systemd.special(7) Feb 28 10:23:51 Telcontar systemd[1]: Reached target Hibernate. Feb 28 10:23:51 Telcontar systemd[1]: Stopped target Hibernate. Feb 28 17:53:35 Telcontar systemd[1]: Reached target Hibernate. Feb 28 17:53:35 Telcontar systemd[1]: Stopped target Hibernate. Feb 28 20:24:14 Telcontar systemd[1]: Reached target Hibernate. Feb 28 20:24:14 Telcontar systemd[1]: Stopped target Hibernate. Mar 01 12:00:50 Telcontar systemd[1]: Reached target Hibernate. Mar 01 12:00:50 Telcontar systemd[1]: Stopped target Hibernate. Mar 02 03:38:31 Telcontar systemd[1]: Dependency failed for Hibernate. Mar 02 03:38:31 Telcontar systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'. cer@Telcontar:~> Notice that the status itself is not failed, so can't be used. Oh, wait! the actual output in the log is: syslog: <3.3> 2022-03-02T03:38:30.497553+01:00 Telcontar systemd-sleep 15519 - - Failed to suspend system. System resumed again: Cannot allocate memory journal: Mar 02 03:38:30 Telcontar systemd-sleep[15519]: Failed to suspend system. System resumed again: Cannot allocate memory It is not the same reason as the status text says. Telcontar:~ # systemctl status sleep.target ● sleep.target - Sleep Loaded: loaded (/usr/lib/systemd/system/sleep.target; static) Active: inactive (dead) since Wed 2022-03-02 03:38:31 CET; 9h ago Docs: man:systemd.special(7) Mar 02 03:38:17 Telcontar systemd[1]: Reached target Sleep. Mar 02 03:38:31 Telcontar systemd[1]: Stopped target Sleep. Telcontar:~ # systemctl status sys Display all 218 possibilities? (y or n) Telcontar:~ # systemctl status systemd-sleep Unit systemd-sleep.service could not be found. Telcontar:~ # - -- Cheers, Carlos E. R. (from openSUSE 15.3 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYh+DGhwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVegkAn1KbdfI4bThTIfOxafw1 fLzCF71xAJ45R/WkcAcwXfj81NC8vcbVpqYbdA== =y8sh -----END PGP SIGNATURE-----
On 02.03.2022 17:45, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 12:56 +0100, Parodper wrote:
O 02/03/22 ás 12:49, Dave Howorth escribiu:
On Wed, 2 Mar 2022 12:26:04 +0100 (CET) "Carlos E. R." <> wrote:
Long ago we decided there was no way to do it. Is there now some way?
Surely it's easy? You just have a script always running
Instead of always running, you can try to create a systemd unit that runs after hibernate.target.
Maybe examine "systemctl status hibernate.target" output.
cer@Telcontar:~> systemctl status hibernate.target ● hibernate.target - Hibernate Loaded: loaded (/usr/lib/systemd/system/hibernate.target; static) Active: inactive (dead) Docs: man:systemd.special(7)
Feb 28 10:23:51 Telcontar systemd[1]: Reached target Hibernate. Feb 28 10:23:51 Telcontar systemd[1]: Stopped target Hibernate. Feb 28 17:53:35 Telcontar systemd[1]: Reached target Hibernate. Feb 28 17:53:35 Telcontar systemd[1]: Stopped target Hibernate. Feb 28 20:24:14 Telcontar systemd[1]: Reached target Hibernate. Feb 28 20:24:14 Telcontar systemd[1]: Stopped target Hibernate. Mar 01 12:00:50 Telcontar systemd[1]: Reached target Hibernate. Mar 01 12:00:50 Telcontar systemd[1]: Stopped target Hibernate. Mar 02 03:38:31 Telcontar systemd[1]: Dependency failed for Hibernate. Mar 02 03:38:31 Telcontar systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'. cer@Telcontar:~>
Notice that the status itself is not failed, so can't be used.
Targets cannot fail, they are either active or not. Still, systemd will start units listed in target's OnFailure when target start job failed.
Oh, wait! the actual output in the log is:
syslog: <3.3> 2022-03-02T03:38:30.497553+01:00 Telcontar systemd-sleep 15519 - - Failed to suspend system. System resumed again: Cannot allocate memory
journal: Mar 02 03:38:30 Telcontar systemd-sleep[15519]: Failed to suspend system. System resumed again: Cannot allocate memory
It is not the same reason as the status text says.
Telcontar:~ # systemctl status sleep.target ● sleep.target - Sleep Loaded: loaded (/usr/lib/systemd/system/sleep.target; static) Active: inactive (dead) since Wed 2022-03-02 03:38:31 CET; 9h ago Docs: man:systemd.special(7)
Mar 02 03:38:17 Telcontar systemd[1]: Reached target Sleep. Mar 02 03:38:31 Telcontar systemd[1]: Stopped target Sleep. Telcontar:~ # systemctl status sys Display all 218 possibilities? (y or n) Telcontar:~ # systemctl status systemd-sleep Unit systemd-sleep.service could not be found. Telcontar:~ #
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2022-03-02 at 22:00 +0300, Andrei Borzenkov wrote:
On 02.03.2022 17:45, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 12:56 +0100, Parodper wrote:
O 02/03/22 ás 12:49, Dave Howorth escribiu:
On Wed, 2 Mar 2022 12:26:04 +0100 (CET) "Carlos E. R." <> wrote:
Long ago we decided there was no way to do it. Is there now some way?
Surely it's easy? You just have a script always running
Instead of always running, you can try to create a systemd unit that runs after hibernate.target.
Maybe examine "systemctl status hibernate.target" output.
cer@Telcontar:~> systemctl status hibernate.target ● hibernate.target - Hibernate Loaded: loaded (/usr/lib/systemd/system/hibernate.target; static) Active: inactive (dead) Docs: man:systemd.special(7)
Feb 28 10:23:51 Telcontar systemd[1]: Reached target Hibernate. Feb 28 10:23:51 Telcontar systemd[1]: Stopped target Hibernate. Feb 28 17:53:35 Telcontar systemd[1]: Reached target Hibernate. Feb 28 17:53:35 Telcontar systemd[1]: Stopped target Hibernate. Feb 28 20:24:14 Telcontar systemd[1]: Reached target Hibernate. Feb 28 20:24:14 Telcontar systemd[1]: Stopped target Hibernate. Mar 01 12:00:50 Telcontar systemd[1]: Reached target Hibernate. Mar 01 12:00:50 Telcontar systemd[1]: Stopped target Hibernate. Mar 02 03:38:31 Telcontar systemd[1]: Dependency failed for Hibernate. Mar 02 03:38:31 Telcontar systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'. cer@Telcontar:~>
Notice that the status itself is not failed, so can't be used.
Targets cannot fail, they are either active or not. Still, systemd will start units listed in target's OnFailure when target start job failed.
Ah. Retrying on automatic might be an endless loop impossible to stop. Maybe if it tried only once. Is it possible to list all such units in a target? Telcontar:~ # systemctl cat hibernate.target # /usr/lib/systemd/system/hibernate.target ... [Unit] Description=Hibernate Documentation=man:systemd.special(7) DefaultDependencies=no Requires=systemd-hibernate.service After=systemd-hibernate.service StopWhenUnneeded=yes Telcontar:~ # Telcontar:~ # systemctl cat sleep.target # /usr/lib/systemd/system/sleep.target ... [Unit] Description=Sleep Documentation=man:systemd.special(7) DefaultDependencies=no RefuseManualStart=yes StopWhenUnneeded=yes Telcontar:~ # Ah, wait... you say "Still, systemd will start units listed in target's OnFailure when target start job failed". So, maybe edit "sleep.target" Telcontar:~ # systemctl cat sleep.target # /usr/lib/systemd/system/sleep.target ... [Unit] Description=Sleep Documentation=man:systemd.special(7) DefaultDependencies=no RefuseManualStart=yes StopWhenUnneeded=yes # /etc/systemd/system/sleep.target.d/override.conf OnFailure=sleepfailure.service Telcontar:~ # Telcontar:~ # systemctl edit --force --full sleepfailure.service ... Telcontar:~ # systemctl cat sleepfailure.service # /etc/systemd/system/sleepfailure.service [Unit] Description=Plays something when sleep.target fails #After=sleep.target Do not want to run always. [Service] Type=oneshot RemainAfterExit=true StandardOutput=tty ExecStart=-/root/ThingsNeededForBoot/sleepfailed Telcontar:~ # Telcontar:~/ThingsNeededForBoot # cat sleepfailed #!/bin/bash # -x su cer -c "XDG_RUNTIME_DIR=/run/user/1000 aplay /usr/local/share/cosas/abitsilly.wav" /usr/bin/logger -t Mine -p daemon.info "Something failed on hibernate, sound play." Telcontar:~ # systemctl status sleepfailure.service ● sleepfailure.service - Plays something when sleep.target fails Loaded: loaded (/etc/systemd/system/sleepfailure.service; static) Active: inactive (dead) Telcontar:~ # Well, we'll see if it works :-) Thanks for the idea. - -- Cheers, Carlos E. R. (from openSUSE 15.3 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYh/LDxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVo/MAoISeWDNSXnlAfLl+pLY5 EsAZQUpdAJ4kA1/k5LmKQoo1vWfRymTaMKxuQg== =EmHN -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2022-03-02 at 20:52 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 22:00 +0300, Andrei Borzenkov wrote:
Ah, wait... you say "Still, systemd will start units listed in target's OnFailure when target start job failed".
So, maybe edit "sleep.target"
...
Well, we'll see if it works :-)
Thanks for the idea.
I tried hibernate minutes ago (which worked), and then I noticed ● sleep.target - Sleep Loaded: loaded (/usr/lib/systemd/system/sleep.target; static) Drop-In: /etc/systemd/system/sleep.target.d └─override.conf Active: inactive (dead) Docs: man:systemd.special(7) Mar 02 20:38:49 Telcontar systemd[1]: /etc/systemd/system/sleep.target.d/override.conf:1: Assignment outside of section. Ignoring. Telcontar:~ # cat /etc/systemd/system/sleep.target.d/override.conf OnFailure=sleepfailure.service Telcontar:~ # Ah. [Unit] OnFailure=sleepfailure.service Will try another hibernate in an hour or so. - -- Cheers, Carlos E. R. (from openSUSE 15.3 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYh/VWxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVE1IAnRBdaFvPU77i8Fhl7cxO InT/DbOLAJoCBHeOdmnuKhtmqQfYJOFva2ikSQ== =yv5j -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2022-03-02 at 21:36 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 20:52 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 22:00 +0300, Andrei Borzenkov wrote:
Ah, wait... you say "Still, systemd will start units listed in target's OnFailure when target start job failed".
So, maybe edit "sleep.target"
...
Well, we'll see if it works :-)
Thanks for the idea.
After days of hibernation without problems, yesterday I had a failed one,
but this service/script did not trigger.
Current status:
Telcontar:~ # systemctl cat sleep.target
# /usr/lib/systemd/system/sleep.target
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Sleep
Documentation=man:systemd.special(7)
DefaultDependencies=no
RefuseManualStart=yes
StopWhenUnneeded=yes
# /etc/systemd/system/sleep.target.d/override.conf
[Unit]
OnFailure=sleepfailure.service
Telcontar:~ #
Telcontar:~ # systemctl cat sleepfailure.service
# /etc/systemd/system/sleepfailure.service
[Unit]
Description=Plays something when sleep.target fails
#After=sleep.target Do not want to run always.
[Service]
Type=oneshot
RemainAfterExit=true
StandardOutput=tty
ExecStart=-/root/ThingsNeededForBoot/sleepfailed
Telcontar:~ #
Telcontar:~ # cat /root/ThingsNeededForBoot/sleepfailed
#!/bin/bash
# -x
su cer -c "XDG_RUNTIME_DIR=/run/user/1000 aplay /usr/local/share/cosas/abitsilly.wav"
/usr/bin/logger -t Mine -p daemon.info "Something failed on hibernate, sound play."
Telcontar:~ #
Journal:
Mar 15 00:16:57 Telcontar sudo[13785]: root : TTY=pts/15 ; PWD=/root ; USER=root ; COMMAND=/usr/bin/systemctl hibernate
Mar 15 00:16:57 Telcontar sudo[13785]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 15 00:16:57 Telcontar sudo[13785]: pam_unix(sudo:session): session closed for user root
Mar 15 00:16:58 Telcontar systemd[1]: Reached target Sleep.
Mar 15 00:16:58 Telcontar systemd[1]: Starting Hibernate...
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: INFO: Running prepare-grub ..
Mar 15 00:16:58 Telcontar systemd-sleep[13840]: 2022-03-15 00:16:58+01:00 - Hibernating the system now...
Mar 15 00:16:58 Telcontar systemd-sh[13841]: Hibernating the system now...
Mar 15 00:16:58 Telcontar systemd-sleep[13832]: service: no such service upsd.service
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: running kernel is grub menu entry main-os (vmlinuz-5.3.18-150300.59.54-default)
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: preparing boot-loader: selecting entry main-os, kernel /boot/5.3.18-150300.59.54-default
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: running /usr/sbin/grub2-once "main-os"
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: time needed for sync: 0.1 seconds, time needed for grub: 0.1 seconds.
Mar 15 00:16:58 Telcontar systemd-sleep[13827]: INFO: Done.
Mar 15 00:17:01 Telcontar sudo[14094]: root : TTY=pts/15 ; PWD=/root ; USER=root ; COMMAND=/usr/local/sbin/beep
Mar 15 00:17:01 Telcontar sudo[14094]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 15 00:17:01 Telcontar sudo[14094]: pam_unix(sudo:session): session closed for user root
Mar 15 00:17:03 Telcontar systemd-sleep[13811]: Suspending system...
Mar 15 00:17:03 Telcontar kernel: PM: hibernation: hibernation entry
Mar 15 00:17:10 Telcontar kernel: Filesystems sync: 0.067 seconds
Mar 15 00:17:11 Telcontar kernel: Freezing user space processes ... (elapsed 0.002 seconds) done.
Mar 15 00:17:11 Telcontar kernel: OOM killer disabled.
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x000a0000-0x000fffff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x09d82000-0x09ffffff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x0a200000-0x0a20bfff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x0b000000-0x0b01ffff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe790d000-0xe790dfff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7929000-0xe792afff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7938000-0xe7938fff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7aa3000-0xe7afffff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7b08000-0xe7b08fff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7b2f000-0xe7b2ffff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xeb8ee000-0xeba37fff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xebaf9000-0xecb1dfff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xef000000-0xffffffff]
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Basic memory bitmaps created
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Preallocating image memory
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Allocated 3261370 pages for shapshot
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Allocated 13045480 kbytes in 3.38 seconds (3859.60 MB/s)
Mar 15 00:17:11 Telcontar kernel: Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
Mar 15 00:17:11 Telcontar kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Mar 15 00:17:11 Telcontar kernel: r8169 0000:22:00.0 eth0: Link is Down
Mar 15 00:17:11 Telcontar kernel: serial 00:05: disabled
Mar 15 00:17:11 Telcontar kernel: parport_pc 00:04: disabled
Mar 15 00:17:11 Telcontar kernel: amdgpu 0000:27:00.0: amdgpu: GPU BACO reset
Mar 15 00:17:11 Telcontar kernel: ACPI: Preparing to enter system sleep state S4
Mar 15 00:17:11 Telcontar kernel: PM: Saving platform NVS memory
Mar 15 00:17:11 Telcontar kernel: Disabling non-boot CPUs ...
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 1 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 2 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 3 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 4 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 5 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 6 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 7 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 8 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 9 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 10 is now offline
Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 11 is now offline
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Creating image:
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Need to copy 4373949 pages
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Normal pages needed: 4373949 + 1024, available pages: 4001491
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Not enough free memory <=====================
Mar 15 00:17:11 Telcontar kernel: smpboot: Booting Node 0 Processor 10 APIC 0xb
Mar 15 00:17:11 Telcontar kernel: microcode: CPU10: patch_level=0x08701013
Mar 15 00:17:11 Telcontar kernel: ACPI: \_PR_.C009: Found 2 idle states
Mar 15 00:17:11 Telcontar kernel: CPU10 is up
Mar 15 00:17:11 Telcontar kernel: smpboot: Booting Node 0 Processor 11 APIC 0xd
Mar 15 00:17:11 Telcontar kernel: microcode: CPU11: patch_level=0x08701013
Mar 15 00:17:11 Telcontar kernel: ACPI: \_PR_.C00B: Found 2 idle states
Mar 15 00:17:11 Telcontar kernel: CPU11 is up
Mar 15 00:17:11 Telcontar kernel: ACPI: Waking up from system sleep state S4
Mar 15 00:17:11 Telcontar kernel: parport_pc 00:04: activated
Mar 15 00:17:11 Telcontar kernel: serial 00:05: activated
Mar 15 00:17:11 Telcontar kernel: ata6: SATA link down (SStatus 0 SControl 330)
Mar 15 00:17:11 Telcontar kernel: ata5: SATA link down (SStatus 0 SControl 330)
Mar 15 00:17:11 Telcontar kernel: ata10: SATA link down (SStatus 0 SControl 300)
Mar 15 00:17:11 Telcontar kernel: ata7: SATA link down (SStatus 0 SControl 330)
Mar 15 00:17:11 Telcontar kernel: ata9: SATA link down (SStatus 0 SControl 300)
Mar 15 00:17:11 Telcontar kernel: nvme nvme0: Shutdown timeout set to 8 seconds
Mar 15 00:17:11 Telcontar kernel: ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar 15 00:17:11 Telcontar kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar 15 00:17:11 Telcontar kernel: ata8: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
Mar 15 00:17:11 Telcontar kernel: ata4: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar 15 00:17:11 Telcontar kernel: ata2.00: configured for UDMA/133
Mar 15 00:17:11 Telcontar kernel: ata8.00: configured for UDMA/133
Mar 15 00:17:11 Telcontar kernel: [drm] PCIE GART of 256M enabled (table at 0x000000F400000000).
Mar 15 00:17:11 Telcontar kernel: ata1.00: configured for UDMA/133
Mar 15 00:17:11 Telcontar kernel: nvme nvme0: 32/0/0 default/read/poll queues
Mar 15 00:17:11 Telcontar kernel: r8169 0000:22:00.0 eth0: Link is Down
Mar 15 00:17:11 Telcontar kernel: ata4.00: configured for UDMA/133
Mar 15 00:17:11 Telcontar kernel: ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar 15 00:17:11 Telcontar kernel: ata3.00: configured for UDMA/133
Mar 15 00:17:11 Telcontar kernel: [drm] Fence fallback timer expired on ring sdma0
Mar 15 00:17:11 Telcontar kernel: [drm] Fence fallback timer expired on ring sdma0
Mar 15 00:17:11 Telcontar kernel: [drm] UVD and UVD ENC initialized successfully.
Mar 15 00:17:11 Telcontar kernel: [drm] VCE initialized successfully.
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Basic memory bitmaps freed
Mar 15 00:17:11 Telcontar kernel: OOM killer enabled.
Mar 15 00:17:11 Telcontar kernel: Restarting tasks ... done.
Mar 15 00:17:11 Telcontar kernel: PM: hibernation: hibernation exit
Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: The canary thread is apparently starving. Taking action.
Mar 15 00:17:10 Telcontar systemd-sleep[13811]: Failed to suspend system. System resumed again: Cannot allocate memory <=====================
Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: Demoting known real-time threads.
Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: Successfully demoted thread 6931 of process 12325 (/usr/lib64/firefox/firefox).
Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: Demoted 1 threads.
Mar 15 00:17:11 Telcontar systemd-sleep[14272]: 2022-03-15 00:17:11+01:00 - Thawing the system now...
Mar 15 00:17:11 Telcontar systemd-sleep[14215]: INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
Mar 15 00:17:11 Telcontar systemd-sleep[14215]: INFO: Running grub-once-restore ..
Mar 15 00:17:11 Telcontar systemd-sleep[14215]: INFO: Done.
Mar 15 00:17:11 Telcontar systemd-sh[14274]: Thawing the system now...
Mar 15 00:17:11 Telcontar systemd-sleep[14221]: service: no such service upsd.service
Mar 15 00:17:11 Telcontar [14214]: /usr/lib/systemd/system-sleep/nut.sh failed with exit status 1.
Mar 15 00:17:11 Telcontar systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
Mar 15 00:17:11 Telcontar systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
Mar 15 00:17:11 Telcontar systemd[1]: Failed to start Hibernate.
Mar 15 00:17:11 Telcontar systemd[1]: Dependency failed for Hibernate.
Mar 15 00:17:11 Telcontar systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.
Mar 15 00:17:11 Telcontar systemd-logind[1797]: Operation 'sleep' finished.
Mar 15 00:17:11 Telcontar systemd[1]: Stopped target Sleep.
Mar 15 00:17:12 Telcontar kernel: r8169 0000:22:00.0 eth0: Link is Up - 1Gbps/Full - flow control off
Mar 15 00:17:12 Telcontar wickedd[1847]: route ipv4 0.0.0.0/0 via 192.168.1.1 dev eth0#2 type unicast table main scope universe protocol boot covered by a ipv4:static lease
Mar 15 00:17:13 Telcontar ModemManager[1813]: <info> Couldn't check support for device '/sys/devices/pci0000:00/0000:00:01.3/0000:03:00.2/0000:20:01.0/0000:22:00.0': not supported by any plugin
Mar 15 00:19:41 Telcontar leafnode[13563]:
On 15.03.2022 14:13, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 21:36 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 20:52 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 22:00 +0300, Andrei Borzenkov wrote:
Ah, wait... you say "Still, systemd will start units listed in target's OnFailure when target start job failed".
So, maybe edit "sleep.target"
...
Well, we'll see if it works :-)
Thanks for the idea.
After days of hibernation without problems, yesterday I had a failed one, but this service/script did not trigger.
Current status:
Telcontar:~ # systemctl cat sleep.target
Unit that failed was hibernate.target, not sleep.target.
# /usr/lib/systemd/system/sleep.target # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version.
[Unit] Description=Sleep Documentation=man:systemd.special(7) DefaultDependencies=no RefuseManualStart=yes StopWhenUnneeded=yes
# /etc/systemd/system/sleep.target.d/override.conf [Unit] OnFailure=sleepfailure.service Telcontar:~ #
Telcontar:~ # systemctl cat sleepfailure.service # /etc/systemd/system/sleepfailure.service [Unit] Description=Plays something when sleep.target fails #After=sleep.target Do not want to run always.
[Service] Type=oneshot RemainAfterExit=true StandardOutput=tty ExecStart=-/root/ThingsNeededForBoot/sleepfailed Telcontar:~ #
Telcontar:~ # cat /root/ThingsNeededForBoot/sleepfailed #!/bin/bash # -x
su cer -c "XDG_RUNTIME_DIR=/run/user/1000 aplay /usr/local/share/cosas/abitsilly.wav" /usr/bin/logger -t Mine -p daemon.info "Something failed on hibernate, sound play." Telcontar:~ #
Journal:
Mar 15 00:16:57 Telcontar sudo[13785]: root : TTY=pts/15 ; PWD=/root ; USER=root ; COMMAND=/usr/bin/systemctl hibernate Mar 15 00:16:57 Telcontar sudo[13785]: pam_unix(sudo:session): session opened for user root by (uid=0) Mar 15 00:16:57 Telcontar sudo[13785]: pam_unix(sudo:session): session closed for user root Mar 15 00:16:58 Telcontar systemd[1]: Reached target Sleep. Mar 15 00:16:58 Telcontar systemd[1]: Starting Hibernate... Mar 15 00:16:58 Telcontar systemd-sleep[13827]: INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate Mar 15 00:16:58 Telcontar systemd-sleep[13827]: INFO: Running prepare-grub .. Mar 15 00:16:58 Telcontar systemd-sleep[13840]: 2022-03-15 00:16:58+01:00 - Hibernating the system now... Mar 15 00:16:58 Telcontar systemd-sh[13841]: Hibernating the system now... Mar 15 00:16:58 Telcontar systemd-sleep[13832]: service: no such service upsd.service Mar 15 00:16:58 Telcontar systemd-sleep[13827]: running kernel is grub menu entry main-os (vmlinuz-5.3.18-150300.59.54-default) Mar 15 00:16:58 Telcontar systemd-sleep[13827]: preparing boot-loader: selecting entry main-os, kernel /boot/5.3.18-150300.59.54-default Mar 15 00:16:58 Telcontar systemd-sleep[13827]: running /usr/sbin/grub2-once "main-os" Mar 15 00:16:58 Telcontar systemd-sleep[13827]: time needed for sync: 0.1 seconds, time needed for grub: 0.1 seconds. Mar 15 00:16:58 Telcontar systemd-sleep[13827]: INFO: Done. Mar 15 00:17:01 Telcontar sudo[14094]: root : TTY=pts/15 ; PWD=/root ; USER=root ; COMMAND=/usr/local/sbin/beep Mar 15 00:17:01 Telcontar sudo[14094]: pam_unix(sudo:session): session opened for user root by (uid=0) Mar 15 00:17:01 Telcontar sudo[14094]: pam_unix(sudo:session): session closed for user root Mar 15 00:17:03 Telcontar systemd-sleep[13811]: Suspending system... Mar 15 00:17:03 Telcontar kernel: PM: hibernation: hibernation entry Mar 15 00:17:10 Telcontar kernel: Filesystems sync: 0.067 seconds Mar 15 00:17:11 Telcontar kernel: Freezing user space processes ... (elapsed 0.002 seconds) done. Mar 15 00:17:11 Telcontar kernel: OOM killer disabled. Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x000a0000-0x000fffff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x09d82000-0x09ffffff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x0a200000-0x0a20bfff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0x0b000000-0x0b01ffff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe790d000-0xe790dfff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7929000-0xe792afff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7938000-0xe7938fff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7aa3000-0xe7afffff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7b08000-0xe7b08fff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xe7b2f000-0xe7b2ffff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xeb8ee000-0xeba37fff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xebaf9000-0xecb1dfff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Marking nosave pages: [mem 0xef000000-0xffffffff] Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Basic memory bitmaps created Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Preallocating image memory Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Allocated 3261370 pages for shapshot Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Allocated 13045480 kbytes in 3.38 seconds (3859.60 MB/s) Mar 15 00:17:11 Telcontar kernel: Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done. Mar 15 00:17:11 Telcontar kernel: printk: Suspending console(s) (use no_console_suspend to debug) Mar 15 00:17:11 Telcontar kernel: r8169 0000:22:00.0 eth0: Link is Down Mar 15 00:17:11 Telcontar kernel: serial 00:05: disabled Mar 15 00:17:11 Telcontar kernel: parport_pc 00:04: disabled Mar 15 00:17:11 Telcontar kernel: amdgpu 0000:27:00.0: amdgpu: GPU BACO reset Mar 15 00:17:11 Telcontar kernel: ACPI: Preparing to enter system sleep state S4 Mar 15 00:17:11 Telcontar kernel: PM: Saving platform NVS memory Mar 15 00:17:11 Telcontar kernel: Disabling non-boot CPUs ... Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 1 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 2 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 3 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 4 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 5 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 6 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 7 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 8 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 9 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 10 is now offline Mar 15 00:17:11 Telcontar kernel: smpboot: CPU 11 is now offline Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Creating image: Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Need to copy 4373949 pages Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Normal pages needed: 4373949 + 1024, available pages: 4001491 Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Not enough free memory <===================== Mar 15 00:17:11 Telcontar kernel: smpboot: Booting Node 0 Processor 10 APIC 0xb Mar 15 00:17:11 Telcontar kernel: microcode: CPU10: patch_level=0x08701013 Mar 15 00:17:11 Telcontar kernel: ACPI: \_PR_.C009: Found 2 idle states Mar 15 00:17:11 Telcontar kernel: CPU10 is up Mar 15 00:17:11 Telcontar kernel: smpboot: Booting Node 0 Processor 11 APIC 0xd Mar 15 00:17:11 Telcontar kernel: microcode: CPU11: patch_level=0x08701013 Mar 15 00:17:11 Telcontar kernel: ACPI: \_PR_.C00B: Found 2 idle states Mar 15 00:17:11 Telcontar kernel: CPU11 is up Mar 15 00:17:11 Telcontar kernel: ACPI: Waking up from system sleep state S4 Mar 15 00:17:11 Telcontar kernel: parport_pc 00:04: activated Mar 15 00:17:11 Telcontar kernel: serial 00:05: activated Mar 15 00:17:11 Telcontar kernel: ata6: SATA link down (SStatus 0 SControl 330) Mar 15 00:17:11 Telcontar kernel: ata5: SATA link down (SStatus 0 SControl 330) Mar 15 00:17:11 Telcontar kernel: ata10: SATA link down (SStatus 0 SControl 300) Mar 15 00:17:11 Telcontar kernel: ata7: SATA link down (SStatus 0 SControl 330) Mar 15 00:17:11 Telcontar kernel: ata9: SATA link down (SStatus 0 SControl 300) Mar 15 00:17:11 Telcontar kernel: nvme nvme0: Shutdown timeout set to 8 seconds Mar 15 00:17:11 Telcontar kernel: ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Mar 15 00:17:11 Telcontar kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Mar 15 00:17:11 Telcontar kernel: ata8: SATA link up 1.5 Gbps (SStatus 113 SControl 300) Mar 15 00:17:11 Telcontar kernel: ata4: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Mar 15 00:17:11 Telcontar kernel: ata2.00: configured for UDMA/133 Mar 15 00:17:11 Telcontar kernel: ata8.00: configured for UDMA/133 Mar 15 00:17:11 Telcontar kernel: [drm] PCIE GART of 256M enabled (table at 0x000000F400000000). Mar 15 00:17:11 Telcontar kernel: ata1.00: configured for UDMA/133 Mar 15 00:17:11 Telcontar kernel: nvme nvme0: 32/0/0 default/read/poll queues Mar 15 00:17:11 Telcontar kernel: r8169 0000:22:00.0 eth0: Link is Down Mar 15 00:17:11 Telcontar kernel: ata4.00: configured for UDMA/133 Mar 15 00:17:11 Telcontar kernel: ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Mar 15 00:17:11 Telcontar kernel: ata3.00: configured for UDMA/133 Mar 15 00:17:11 Telcontar kernel: [drm] Fence fallback timer expired on ring sdma0 Mar 15 00:17:11 Telcontar kernel: [drm] Fence fallback timer expired on ring sdma0 Mar 15 00:17:11 Telcontar kernel: [drm] UVD and UVD ENC initialized successfully. Mar 15 00:17:11 Telcontar kernel: [drm] VCE initialized successfully. Mar 15 00:17:11 Telcontar kernel: PM: hibernation: Basic memory bitmaps freed Mar 15 00:17:11 Telcontar kernel: OOM killer enabled. Mar 15 00:17:11 Telcontar kernel: Restarting tasks ... done. Mar 15 00:17:11 Telcontar kernel: PM: hibernation: hibernation exit Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: The canary thread is apparently starving. Taking action. Mar 15 00:17:10 Telcontar systemd-sleep[13811]: Failed to suspend system. System resumed again: Cannot allocate memory <===================== Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: Demoting known real-time threads. Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: Successfully demoted thread 6931 of process 12325 (/usr/lib64/firefox/firefox). Mar 15 00:17:10 Telcontar rtkit-daemon[11233]: Demoted 1 threads. Mar 15 00:17:11 Telcontar systemd-sleep[14272]: 2022-03-15 00:17:11+01:00 - Thawing the system now... Mar 15 00:17:11 Telcontar systemd-sleep[14215]: INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate Mar 15 00:17:11 Telcontar systemd-sleep[14215]: INFO: Running grub-once-restore .. Mar 15 00:17:11 Telcontar systemd-sleep[14215]: INFO: Done. Mar 15 00:17:11 Telcontar systemd-sh[14274]: Thawing the system now... Mar 15 00:17:11 Telcontar systemd-sleep[14221]: service: no such service upsd.service Mar 15 00:17:11 Telcontar [14214]: /usr/lib/systemd/system-sleep/nut.sh failed with exit status 1. Mar 15 00:17:11 Telcontar systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE Mar 15 00:17:11 Telcontar systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'. Mar 15 00:17:11 Telcontar systemd[1]: Failed to start Hibernate. Mar 15 00:17:11 Telcontar systemd[1]: Dependency failed for Hibernate. Mar 15 00:17:11 Telcontar systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'. Mar 15 00:17:11 Telcontar systemd-logind[1797]: Operation 'sleep' finished. Mar 15 00:17:11 Telcontar systemd[1]: Stopped target Sleep. Mar 15 00:17:12 Telcontar kernel: r8169 0000:22:00.0 eth0: Link is Up - 1Gbps/Full - flow control off Mar 15 00:17:12 Telcontar wickedd[1847]: route ipv4 0.0.0.0/0 via 192.168.1.1 dev eth0#2 type unicast table main scope universe protocol boot covered by a ipv4:static lease Mar 15 00:17:13 Telcontar ModemManager[1813]: <info> Couldn't check support for device '/sys/devices/pci0000:00/0000:00:01.3/0000:03:00.2/0000:20:01.0/0000:22:00.0': not supported by any plugin Mar 15 00:19:41 Telcontar leafnode[13563]:
205 Always happy to serve! Mar 15 00:19:41 Telcontar leafnode[13564]: 205 Always happy to serve! Mar 15 00:19:41 Telcontar systemd[1]: Started Leafnode NNTP server (127.0.0.1:46746). Mar 15 00:19:41 Telcontar systemd[1]: Started Leafnode NNTP server (127.0.0.1:46748). ... I noticed some minutes later, and tried again, which worked. But got no warning notice or bell as intended. Not even a mention of trying to run my hook in the logs.
On 2022-03-16 18:05, Andrei Borzenkov wrote:
On 15.03.2022 14:13, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 21:36 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 20:52 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 22:00 +0300, Andrei Borzenkov wrote:
Ah, wait... you say "Still, systemd will start units listed in target's OnFailure when target start job failed".
So, maybe edit "sleep.target"
...
Well, we'll see if it works :-)
Thanks for the idea.
After days of hibernation without problems, yesterday I had a failed one, but this service/script did not trigger.
Current status:
Telcontar:~ # systemctl cat sleep.target
Unit that failed was hibernate.target, not sleep.target.
Ah... Ok, will change. Thanks. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2022-03-16 at 19:38 +0100, Carlos E. R. wrote:
On 2022-03-16 18:05, Andrei Borzenkov wrote:
On 15.03.2022 14:13, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 21:36 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 20:52 +0100, Carlos E. R. wrote:
On Wednesday, 2022-03-02 at 22:00 +0300, Andrei Borzenkov wrote:
Ah, wait... you say "Still, systemd will start units listed in target's OnFailure when target start job failed".
So, maybe edit "sleep.target"
...
Well, we'll see if it works :-)
Thanks for the idea.
After days of hibernation without problems, yesterday I had a failed one, but this service/script did not trigger.
Current status:
Telcontar:~ # systemctl cat sleep.target
Unit that failed was hibernate.target, not sleep.target.
Ah... Ok, will change. Thanks.
It worked! I had an hibernation failure just now, and the speaker warned me - I'm so happy :-) <3.5> 2022-03-18T23:09:28.639228+01:00 Telcontar systemd 1 - - systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE <3.4> 2022-03-18T23:09:28.639320+01:00 Telcontar systemd 1 - - systemd-hibernate.service: Failed with result 'exit-code'. <3.3> 2022-03-18T23:09:28.639369+01:00 Telcontar systemd 1 - - Failed to start Hibernate. <3.4> 2022-03-18T23:09:28.639424+01:00 Telcontar systemd 1 - - Dependency failed for Hibernate. <3.5> 2022-03-18T23:09:28.639478+01:00 Telcontar systemd 1 - - hibernate.target: Job hibernate.target/start failed with result 'dependency'. <3.6> 2022-03-18T23:09:28.639535+01:00 Telcontar systemd 1 - - hibernate.target: Triggering OnFailure= dependencies. <4.6> 2022-03-18T23:09:28.639693+01:00 Telcontar systemd-logind 1790 - - Operation 'sleep' finished. <3.6> 2022-03-18T23:09:28.641730+01:00 Telcontar systemd 1 - - Stopped target Sleep. <3.6> 2022-03-18T23:09:28.642693+01:00 Telcontar systemd 1 - - Starting Plays something when hibernate.target fails... <4.5> 2022-03-18T23:09:28.650125+01:00 Telcontar su - - - (to cer) root on none <10.6> 2022-03-18T23:09:28.657072+01:00 Telcontar su - - - pam_unix(su:session): session opened for user cer by (uid=0) <3.6> 2022-03-18T23:09:28.960935+01:00 Telcontar dbus-daemon 1569 - - [system] Activating via systemd: service name='org.freedesktop.Accounts' unit='accounts-daemon.service' requested by ':1.139' (uid=1000 pid=13378 comm="/usr/lib/xfce4-screensaver-dialog --monitor=0 --he") <3.6> 2022-03-18T23:09:28.963790+01:00 Telcontar systemd 1 - - Starting Accounts Service... <3.6> 2022-03-18T23:09:29.008433+01:00 Telcontar accounts-daemon 13419 - - started daemon version 0.6.55 <3.6> 2022-03-18T23:09:29.008602+01:00 Telcontar dbus-daemon 1569 - - [system] Successfully activated service 'org.freedesktop.Accounts' <3.6> 2022-03-18T23:09:29.008680+01:00 Telcontar systemd 1 - - Started Accounts Service. <1.4> 2022-03-18T23:09:29.008787+01:00 Telcontar accounts-daemon 13419 - - g_dbus_interface_skeleton_get_object_path: assertion 'G_IS_DBUS_INTERFACE_SKELETON (interface_)' failed <3.6> 2022-03-18T23:09:31.154795+01:00 Telcontar ModemManager 1815 - - <info> Couldn't check support for device '/sys/devices/pci0000:00/0000:00:01.3/0000:03:00.2/0000:20:01.0/0000:22:00.0': not supported by any plugin <10.6> 2022-03-18T23:09:33.346148+01:00 Telcontar su - - - pam_unix(su:session): session closed for user cer <3.6> 2022-03-18T23:09:33.347105+01:00 Telcontar systemd 1 - - session-c2.scope: Succeeded. <3.6> 2022-03-18T23:09:33.381041+01:00 Telcontar Mine - - - Something failed on hibernate, sound play. <3.6> 2022-03-18T23:09:33.381702+01:00 Telcontar systemd 1 - - Finished Plays something when hibernate.target fails. The cause of hibernation failure is not relevant to this thread, but for completeness, it is: <3.3> 2022-03-18T23:09:28.541853+01:00 Telcontar systemd-sleep 12863 - - Failed to suspend system. System resumed again: Cannot allocate memory - -- Cheers, Carlos E. R. (from openSUSE 15.3 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYjUEvxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV6h0An0L8HMZLSUd7ZOoscmeF FaQOXkFpAJ44F4fuyrYotXuOG8R7LpmevhFbbg== =vwiJ -----END PGP SIGNATURE-----
participants (4)
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Howorth
-
Parodper