Troubleshooting

SELinux Troubleshooting

SELinux Troubleshooting #

Here’s a little guide on how to find if SELinux is blocking something and how to add an exception to the policy.

SELinux Modes #

SELinux operates in three modes:

# Check SELinux status and mode
sestatus

Understanding the Three Modes #

  1. Enforcing: SELinux policy is enforced
  2. Permissive: SELinux policy violations are logged but not blocked
  3. Disabled: SELinux is completely disabled

Check if SELinux is the problem #

# Temporarily set to permissive mode and test
setenforce 0
# Test your application
# If it works now, SELinux was blocking it
setenforce 1

Troubleshooting Workflow #

When an application fails and you are certain that SELinux is blocking it, e.g. you turned SELinux off or into permissive mode and the application worked, you can do the following:

Resolving Git Submodule Tracking Issues

Resolving Git Submodule Tracking Issues #

The Problem #

I recently encountered a frustrating Git issue with my Hugo blog setup. I had installed the Hugo Book theme as a Git submodule for my static site, but for some reason there were a bunch of changed files showing up in the theme’s directory even though I had never run git submodule update or made any intentional changes to it. At the time, I didn’t really understand how submodules work, so I tried adding it to .gitignore thinking that would solve the problem.