I tried again after entering this code.
$ sudo semodule -i systemd_sleep.pp
$ systemctl hibernate
It seemed to work. The screen turned off, the monitor disconnected. But the PC didn’t shut down. After 1 minute, the image came back. The user account login screen came up. I entered the password and logged into my account. I continued where I left off, the browser etc. was still open.
$ sudo audit2allow -b -M systemd_sleep
Option ENRICHED not found - line 9
NOTE - using built-in end_of_event_timeout: 2
NOTE - using built-in logs: /var/log/audit/audit.log
compilation failed:
systemd_sleep.te:6:ERROR 'syntax error' at token '0' on line 6:
/usr/bin/checkmodule: error(s) encountered while parsing configuration