Failures Caused by SELinux

What Went Wrong?

Introduction

Sometimes you met a problem, you tried to debug, but found nothing was wrong. Then what went wrong? The failures may be caused by SELinux.

Failure Types

Permission Denied

Service fails to start, the log only says “Permission denied”.

One common situation is a container startup failure.

Network Connection Denied

Unable to establish a connection.

Solution

Check SELinux Status

1
getenforce

Enforcing means SELinux is working.
Permissive means it only records.

Disable SELinux Temporarily

1
sudo setenforce 0

Disable SELinux Permenantly

OS: Silverblue

1
sudo rpm-ostree kargs --append enforcing=0

or

1
sudo rpm-ostree kargs --editor

then add enforcing=0.

Licensed under CC BY-NC-SA 4.0
"Decouple with me!" -- said Java.