Directory with specific persistent SELinux security context keeps getting relabeled to default_t on reboot
Issue
A custom directory under the root filesystem, say '/example/', is required to have the SELinux security context type 'home_root_t'. For persistence of the security context, an SELinux policy module containing the file context rule is loaded on the system, with the entry given below.
/example system_u:object_r:home_root_t:s0
When the 'restorecon' command is run on the directory, the SELinux security context is set correctly, as expected.
However after every reboot, the directory is being relabeled as 'default_t'.
Environment
Red Hat Enterprise Linux 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
