I've changed nothing since upgrading to F40 a week ago, yet I now find these errors in the journal:
Apr 30 01:02:39 Bree systemd[1]: Reached target sleep.target - Sleep. Apr 30 01:02:39 Bree systemd[1]: Starting hibernate-preparation.service - Enable swap file and disable zram before hibernate... Apr 30 01:02:42 Bree systemd[1]: dev-zram0.swap: Deactivated successfully. Apr 30 01:02:42 Bree systemd[1]: hibernate-preparation.service: Deactivated successfully. Apr 30 01:02:42 Bree systemd[1]: Finished hibernate-preparation.service - Enable swap file and disable zram before hibernate. Apr 30 01:02:42 Bree systemd[1]: hibernate-preparation.service: Consumed 2.698s CPU time. Apr 30 01:02:42 Bree systemd[1]: Starting systemd-hibernate.service - System Hibernate... Apr 30 01:02:42 Bree systemd[1]: Stopping systemd-zram-setup@zram0.service - Create swap on /dev/zram0... Apr 30 01:02:42 Bree systemd-sleep[90707]: Failed to find location to hibernate to: Operation not permitted <------------------ Apr 30 01:02:42 Bree systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE Apr 30 01:02:42 Bree systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'. Apr 30 01:02:42 Bree systemd[1]: Failed to start systemd-hibernate.service - System Hibernate. Apr 30 01:02:42 Bree systemd[1]: Dependency failed for hibernate.target - System Hibernation. Apr 30 01:02:42 Bree systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'. Apr 30 01:02:42 Bree systemd-logind[1061]: Operation 'hibernate' finished. ...skipping...
And the system is not hibernating.
/dev/zram0 exists and is configured:
# swapon NAME TYPE SIZE USED PRIO /SWAP/swapfile file 48G 0B -2 /dev/zram0 partition 8G 512K 100
poc
On 4/30/24 5:19 AM, Patrick O'Callaghan wrote:
I've changed nothing since upgrading to F40 a week ago, yet I now find these errors in the journal:
Apr 30 01:02:39 Bree systemd[1]: Reached target sleep.target - Sleep. Apr 30 01:02:39 Bree systemd[1]: Starting hibernate-preparation.service - Enable swap file and disable zram before hibernate... Apr 30 01:02:42 Bree systemd[1]: dev-zram0.swap: Deactivated successfully. Apr 30 01:02:42 Bree systemd[1]: hibernate-preparation.service: Deactivated successfully. Apr 30 01:02:42 Bree systemd[1]: Finished hibernate-preparation.service - Enable swap file and disable zram before hibernate. Apr 30 01:02:42 Bree systemd[1]: hibernate-preparation.service: Consumed 2.698s CPU time. Apr 30 01:02:42 Bree systemd[1]: Starting systemd-hibernate.service - System Hibernate... Apr 30 01:02:42 Bree systemd[1]: Stopping systemd-zram-setup@zram0.service - Create swap on /dev/zram0... Apr 30 01:02:42 Bree systemd-sleep[90707]: Failed to find location to hibernate to: Operation not permitted <------------------ Apr 30 01:02:42 Bree systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE Apr 30 01:02:42 Bree systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'. Apr 30 01:02:42 Bree systemd[1]: Failed to start systemd-hibernate.service - System Hibernate. Apr 30 01:02:42 Bree systemd[1]: Dependency failed for hibernate.target - System Hibernation. Apr 30 01:02:42 Bree systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'. Apr 30 01:02:42 Bree systemd-logind[1061]: Operation 'hibernate' finished. ...skipping...
And the system is not hibernating.
/dev/zram0 exists and is configured:
Yes, and you can see it being disabled in the logs because you can't hibernate to RAM.
# swapon NAME TYPE SIZE USED PRIO /SWAP/swapfile file 48G 0B -2 /dev/zram0 partition 8G 512K 100
Do you have secure boot enabled?
On Tue, 2024-04-30 at 15:36 -0700, Samuel Sieb wrote:
And the system is not hibernating. /dev/zram0 exists and is configured:
Yes, and you can see it being disabled in the logs because you can't hibernate to RAM.
# swapon NAME TYPE SIZE USED PRIO /SWAP/swapfile file 48G 0B -2 /dev/zram0 partition 8G 512K 100
Do you have secure boot enabled?
No, however today's log is different:
May 01 01:02:44 Bree systemd[1]: Starting hibernate-preparation.service - Enable swap file and disable zram before hibernate... May 01 01:02:44 Bree kernel: [drm] scheduler comp_1.1.1 is not ready, skipping May 01 01:02:44 Bree kernel: [drm] scheduler comp_1.0.1 is not ready, skipping May 01 01:02:44 Bree kernel: [drm] scheduler comp_1.1.1 is not ready, skipping May 01 01:02:44 Bree kernel: [drm] scheduler comp_1.0.1 is not ready, skipping May 01 01:02:45 Bree systemd[1]: dev-zram0.swap: Deactivated successfully. May 01 01:02:45 Bree systemd[1]: hibernate-preparation.service: Deactivated successfully. May 01 01:02:45 Bree systemd[1]: Finished hibernate-preparation.service - Enable swap file and disable zram before hibernate. May 01 01:02:45 Bree systemd[1]: hibernate-preparation.service: Consumed 1.158s CPU time. May 01 01:02:45 Bree systemd[1]: Starting systemd-hibernate.service - System Hibernate... May 01 01:02:45 Bree systemd[1]: Stopping systemd-zram-setup@zram0.service - Create swap on /dev/zram0... May 01 01:02:45 Bree kernel: [drm] scheduler comp_1.1.1 is not ready, skipping May 01 01:02:45 Bree kernel: zram0: detected capacity change from 16777216 to 0 May 01 01:02:45 Bree kernel: hpet: Lost 1 RTC interrupts May 01 01:02:45 Bree systemd-sleep[130021]: Performing sleep operation 'hibernate'... May 01 01:02:45 Bree kernel: PM: hibernation: hibernation entry May 01 01:02:45 Bree systemd[1]: systemd-zram-setup@zram0.service: Deactivated successfully. May 01 01:02:45 Bree systemd[1]: Stopped systemd-zram-setup@zram0.service - Create swap on /dev/zram0. May 01 08:00:48 Bree kernel: Filesystems sync: 0.164 seconds May 01 08:00:50 Bree kernel: Freezing user space processes
and hibernation did work. Possibly a timing issue, so I'll have to look at my hibernate-preparation script:
$ cat /etc/systemd/system/hibernate-preparation.service [Unit] Description=Enable swap file and disable zram before hibernate Before=systemd-hibernate.service
[Service] SyslogIdentifier=%N User=root Type=oneshot
ExecStart=/bin/bash -c ' \ swapon -a; \ swapoff /dev/zram0; \ exit 0; \ '
[Install] WantedBy=systemd-hibernate.service
poc
Hi
On Wed, 01 May 2024 10:51:34 +0100 Patrick O'Callaghan wrote:
May 01 08:00:50 Bree kernel: Freezing user space processes
and hibernation did work. Possibly a timing issue, so I'll have to look at my hibernate-preparation script:
Yes: simply replace ExecStart by ExecStartPre. This will make systemd-hibernate surely start after this script.
Thus:
$ cat /etc/systemd/system/hibernate-preparation.service [Unit] Description=Enable swap file and disable zram before hibernate Before=systemd-hibernate.service
[Service] SyslogIdentifier=%N User=root Type=oneshot
ExecStartPre=/bin/bash -c ' \ swapon -a; \ swapoff /dev/zram0; \ exit 0; \ '
[Install] WantedBy=systemd-hibernate.service
You don't need to specify an ExecStart.
On Wed, 2024-05-01 at 14:42 +0200, Francis.Montagnac@inria.fr wrote:
Hi
On Wed, 01 May 2024 10:51:34 +0100 Patrick O'Callaghan wrote:
May 01 08:00:50 Bree kernel: Freezing user space processes
and hibernation did work. Possibly a timing issue, so I'll have to look at my hibernate-preparation script:
Yes: simply replace ExecStart by ExecStartPre. This will make systemd-hibernate surely start after this script.
Thus:
$ cat /etc/systemd/system/hibernate-preparation.service [Unit] Description=Enable swap file and disable zram before hibernate Before=systemd-hibernate.service
[Service] SyslogIdentifier=%N User=root Type=oneshot
ExecStartPre=/bin/bash -c ' \ swapon -a; \ swapoff /dev/zram0; \ exit 0; \ '
[Install] WantedBy=systemd-hibernate.service
You don't need to specify an ExecStart.
I want to disable swap on zram0 and make sure it's enabled on secondary storage. Do you mean that will happen automatically?
poc
On Wed, 01 May 2024 17:01:47 +0100 Patrick O'Callaghan wrote:
On Wed, 2024-05-01 at 14:42 +0200, Francis.Montagnac@inria.fr wrote:
On Wed, 01 May 2024 10:51:34 +0100 Patrick O'Callaghan wrote:
May 01 08:00:50 Bree kernel: Freezing user space processes
and hibernation did work. Possibly a timing issue, so I'll have to look at my hibernate-preparation script:
Yes: simply replace ExecStart by ExecStartPre. This will make systemd-hibernate surely start after this script.
You don't need to specify an ExecStart.
I want to disable swap on zram0 and make sure it's enabled on secondary storage.
I got that.
Do you mean that will happen automatically?
No: your hibernate-preparation script is needed.
systemd do not wait for an ExecStart command to finish before starting the next job (here systemd-hibernate.service).
On the opposite, it waits for an ExecStartPre to finish before executing the ExecStart.
I was wrong saying that an ExecStart was not needed.
Try thus that:
[Unit] Description=Enable swap file and disable zram before hibernate Before=systemd-hibernate.service
[Service] SyslogIdentifier=%N User=root Type=oneshot
ExecStartPre=/bin/bash -c ' \ swapon -a; \ swapoff /dev/zram0; \ exit 0; \ '
ExecStart=/bin/true
[Install] WantedBy=systemd-hibernate.service
On Wed, 2024-05-01 at 18:21 +0200, Francis.Montagnac@inria.fr wrote:
On Wed, 01 May 2024 17:01:47 +0100 Patrick O'Callaghan wrote:
On Wed, 2024-05-01 at 14:42 +0200, Francis.Montagnac@inria.fr wrote:
On Wed, 01 May 2024 10:51:34 +0100 Patrick O'Callaghan wrote:
May 01 08:00:50 Bree kernel: Freezing user space processes
and hibernation did work. Possibly a timing issue, so I'll have to look at my hibernate-preparation script:
Yes: simply replace ExecStart by ExecStartPre. This will make systemd-hibernate surely start after this script.
You don't need to specify an ExecStart.
I want to disable swap on zram0 and make sure it's enabled on secondary storage.
I got that.
Do you mean that will happen automatically?
No: your hibernate-preparation script is needed.
systemd do not wait for an ExecStart command to finish before starting the next job (here systemd-hibernate.service).
On the opposite, it waits for an ExecStartPre to finish before executing the ExecStart.
Yes,that makes sense.
I was wrong saying that an ExecStart was not needed.
Try thus that:
[Unit] Description=Enable swap file and disable zram before hibernate Before=systemd-hibernate.service
[Service] SyslogIdentifier=%N User=root Type=oneshot
ExecStartPre=/bin/bash -c ' \ swapon -a; \ swapoff /dev/zram0; \ exit 0; \ '
ExecStart=/bin/true
[Install] WantedBy=systemd-hibernate.service
I'll try that, thanks.
poc