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. poc _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue