Skip to content

Commit

Permalink
Merge pull request #639 from Kegeruneku/arch_6517/int/6517_selinux_co…
Browse files Browse the repository at this point in the history
…mpatibility

Fixes #6517: Add initial SELinux support
  • Loading branch information
peckpeck committed Apr 27, 2015
2 parents 8973565 + 9f07c4f commit be28319
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rudder-webapp/SPECS/rudder-webapp.spec
Expand Up @@ -400,6 +400,19 @@ if [ ! -f /opt/rudder/etc/ssl/rudder-webapp.crt ] || [ ! -f /opt/rudder/etc/ssl/
echo " Done"
fi

# SELinux support
# Check "sestatus" presence, and if here, probe if SELinux
# is enabled. If so, then tweak our installation to be
# SELinux compliant
if type sestatus >/dev/null 2>&1
if [ $(LANG=C sestatus | grep -cE "SELinux status:.*enabled") -ne 0 ]
then
# Adjust the inventory directories SELinux context
chcon -R --type=httpd_sys_content_t /var/rudder/inventories/incoming
chcon -R --type=httpd_sys_content_t /var/rudder/inventories/accepted-nodes-updates
fi
fi

echo -n "INFO: Starting Apache HTTPd..."
service %{apache} start >/dev/null 2>&1
echo " Done"
Expand Down
13 changes: 13 additions & 0 deletions rudder-webapp/debian/postinst
Expand Up @@ -89,6 +89,19 @@ case "$1" in
echo " Done"
fi

# SELinux support
# Check "sestatus" presence, and if here, probe if SELinux
# is enabled. If so, then tweak our installation to be
# SELinux compliant
if type sestatus >/dev/null 2>&1
if [ $(LANG=C sestatus | grep -cE "SELinux status:.*enabled") -ne 0 ]
then
# Adjust the inventory directories SELinux context
chcon -R --type=httpd_sys_content_t /var/rudder/inventories/incoming
chcon -R --type=httpd_sys_content_t /var/rudder/inventories/accepted-nodes-updates
fi
fi

echo -n "INFO: Restarting Apache HTTPd..."
/etc/init.d/apache2 restart >/dev/null 2>&1
echo " Done"
Expand Down

0 comments on commit be28319

Please sign in to comment.