We recently experienced a power failure and simultaneous backup generator failure, severe enough to require safely shutting down all servers as their UPSs were draining.
Upon bringing one CentOS 7.4.1708 server back up (its first "reboot" in months, but it is up-to-date in terms of CentOS updates) I hit a brick wall preventing me from booting it with SELinux enabled. I have researched extensively but can't seem to find evidence that anyone else has experienced this, nor do I know what to try next. I'm hoping someone here can offer up some ideas.
Here's the timeline:
- Booted
Boot failed due to several services not starting up:
FAILED Failed to start Login Service. See 'systemctl status systemd-logind.service' for details. FAILED Failed to start Authorization Manager. See 'systemctl status polkit.service' for details. DEPEND Dependency failed for Dynamic System Tuning Daemon.
Prompted by this I rebooted with
selinux=0
in grubThis works and gets the system running, but with SELinux disabled which is not viable for us as anything other than a temporary workaround
Followed advice found online:
sudo yum reinstall selinux-policy-targeted
Rebooted
Boot now failed due to:
Failed to load SELinux policy, freezing
Rebooted with
selinux=0
in grub againFound more advice so performed:
sudo yum reinstall selinux-policy-targeted sudo touch /.autorelabel
and set permissive in
/etc/selinux/config
Rebooted
Could see the following banner:
Warning -- SELinux targeted policy relabel is required. Relabeling could take a very long time, depending on file system size and speed of hard drives.
but instead of actually performing the relabelling, the system immediately rebooted itself — too fast to see any other output
Boot again failed with the original error.
So ugh we're back here again. And I can see that
/.autorelabel
still exists, suggesting the relabel didn't happen. It's surprising to me that we're back to square one with the errors though.Also recall that SELinux is still in permissive mode, not enforcing.
The end result is that I'm stuck without being able to enable SELinux in either permissive or enforcing mode, which is not okay.
How should I proceed?