Re: More hibernation mystery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Mon, 2023-08-14 at 08:05 +0200, Francis.Montagnac@xxxxxxxx wrote:
> On Sun, 13 Aug 2023 22:12:23 +0100 Patrick O'Callaghan wrote:
> > On Sun, 2023-08-13 at 18:49 +0200,
> > Francis.Montagnac@xxxxxxxx wrote:
> > > ExecStart=/bin/bash -c '/usr/sbin/swapon /SWAP/swapfile &&
> > > /usr/sbin/swapoff /dev/zram0'
> > I'll do that, but I don't understand why it sometimes works and
> > sometimes doesn't.
> The journal when it succeeds shows that /SWAP/swapfile was activated.
> That may
> be due to hibernate-resume.service previously failed or was not
> called.

I don't think so but I'd need to think it through.

> In addition swapon fails when the swapfile is already activated. A
> better
> hibernate-preparation.service would be:
>   ExecStart=/bin/bash -c ' \
>       if ! swapon --show=NAME --noheadings | grep -q /SWAP/swapfile;
> then \
>           swapon /SWAP/swapfile || exit; \
>       fi; \
>       swapoff /dev/zram0; \
>       # Ignores the exit code of swapoff.
>       exit 0; \
>   '

I'll add that as a defensive measure.

Thanks again.

users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct:
List Guidelines:
List Archives:
Do not reply to spam, report it:

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux