semanage commands fail with SELinux: Could not downgrade policy file
Issue
When running semanage
commands to modify default selinux policy, the following error message is displayed:
# semanage fcontext -a -t unconfined_exec_t /usr/sbin/httpd
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.24, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.24: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.24, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.24: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
/usr/sbin/semanage: Could not commit semanage transaction
although the policy file exists:
# ls -lh /etc/selinux/targeted/policy/policy.24
-rw-r--r-- 1 root root 7.7M Sep 23 12:34 /etc/selinux/targeted/policy/policy.24
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.