How to exclude a path from reassign selinux context when using /.autorelabel?
Issue
During installation we move data from /var
, /tmp
and /home
to a /SHARED
mounted logical volume and use bind mounts to have /var
, /tmp
and /home
linked to that. When we trigger an autorelabel of the selinux contexts, using touch /.autorelabel
, all files in /SHARED
gets relabelled to default_t
# ll -Z /var/log/lastlog
-rw-r--r--. root root system_u:object_r:default_t:s0 /var/log/lastlog
The issue is if a "autorelabel" is triggered again the selinux contexts for the "SHARED/nnnn" filesystems will be reset.
Is there a way to handle this?
Environment
Red Hat Enterprise Linux 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.