HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

restorecond — Daemon that monitors file creation and automatically restores SELinux contexts. Useful for directori

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandrestorecondcreationmonitorsdaemonclifilethat
linux

Problem

How to use the restorecond command: Daemon that monitors file creation and automatically restores SELinux contexts. Useful for directories where files are frequently created with incorrect contexts. See also: restorecon, semanage-fcontext. More information: <https://manned.org/restorecond>.

Solution

restorecond — Daemon that monitors file creation and automatically restores SELinux contexts. Useful for directories where files are frequently created with incorrect contexts. See also: restorecon, semanage-fcontext. More information: <https://manned.org/restorecond>.

Start the restorecond daemon:
sudo restorecond


Run restorecond in [v]erbose mode to see restoration events:
sudo restorecond -v


Run restorecond in [d]ebug mode:
sudo restorecond -d


Use alternative restorecond.conf file:
sudo restorecond -f restorecond_file


Check the status of the restorecond service:
sudo systemctl status restorecond


Enable restorecond to start at boot:
sudo systemctl enable restorecond --now

Code Snippets

Start the `restorecond` daemon

sudo restorecond

Run `restorecond` in [v]erbose mode to see restoration events

sudo restorecond -v

Run `restorecond` in [d]ebug mode

sudo restorecond -d

Use alternative `restorecond.conf` file

sudo restorecond -f restorecond_file

Check the status of the restorecond service

sudo systemctl status restorecond

Context

tldr-pages: linux/restorecond

Revisions (0)

No revisions yet.