Re: SELinux prevents systemctl hibernate [SOLVED]

2022-04-18 Thread Alexander Zhang
It worked after I did `setenforce 0`, so SELinux is the problem. I have my swap file inside its own BTRFS subvolume mounted at /swap and the SELinux context for that directory is system_u:object_r:unlabeled_t:s0. It looks like I need to allow systemd-sleep to search that directory. I think the

Re: SELinux prevents systemctl hibernate

2022-04-17 Thread Samuel Sieb
On 4/17/22 22:09, Joe Zeff wrote: On 4/17/22 22:47, Alexander Zhang wrote: It worked after I did `setenforce 0`, so SELinux is the problem. I have my swap file inside its own BTRFS subvolume mounted at /swap and the SELinux context for that directory is system_u:object_r:unlabeled_t:s0. It loo

Re: SELinux prevents systemctl hibernate

2022-04-17 Thread Alexander Zhang
Easier still is to remove that partition from fstab and reformat it as a swap partition. I guess I can use a swap partition, but since I use LUKS without LVM, I would have to make a separate LUKS volume. I wanted to use a swap file so that everything is in one LUKS volume. (I forgot to reply

Re: SELinux prevents systemctl hibernate

2022-04-17 Thread Joe Zeff
On 4/17/22 22:47, Alexander Zhang wrote: It worked after I did `setenforce 0`, so SELinux is the problem. I have my swap file inside its own BTRFS subvolume mounted at /swap and the SELinux context for that directory is system_u:object_r:unlabeled_t:s0. It looks like I need to allow systemd-sle

Re: SELinux prevents systemctl hibernate

2022-04-17 Thread Alexander Zhang
First try would be to disable SELinux to confirm your hypothesis. However even if you fix the selinux problem i do not think this will work, you need to have a swap partition for hibernate / resume to work, the systemd-hibernate-resume man page makes reference to needing a specific device node.

Re: SELinux prevents systemctl hibernate

2022-04-16 Thread Steven Taylor
Hi, From the error message you are getting the it looks like the swapfile or the directory it is sat in has the wrong label. you can use some of the policy tools to fix this by setting the correct context... the RHEL guide is good source for this https://access.redhat.com/documentation/en-us/red_

Re: SELinux prevents systemctl hibernate

2022-04-16 Thread Ranjan Maitra
On Fri Apr15'22 11:31:25PM, Alexander Zhang wrote: > Hello, > > I'm trying to enable hibernation to a swap file on Fedora 35. I've created a > swapfile on a new BTRFS subvolume, added the resume dracut module, and set > the kernel command line arguments. I've also added > SYSTEMD_BYPASS_HIBERNATIO

Re: SELinux prevents systemctl hibernate

2022-04-16 Thread Roberto Ragusa
On 4/16/22 8:31 AM, Alexander Zhang wrote: Hello, I'm trying to enable hibernation to a swap file on Fedora 35. I've created a swapfile on a new BTRFS subvolume, added the resume dracut module, and set the kernel command line arguments. I've also added SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1

SELinux prevents systemctl hibernate

2022-04-15 Thread Alexander Zhang
Hello, I'm trying to enable hibernation to a swap file on Fedora 35. I've created a swapfile on a new BTRFS subvolume, added the resume dracut module, and set the kernel command line arguments. I've also added SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1 to the environments of systemd-hibernate