POSTIN
/bin/sh
(
# New File context
semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "/etc/glpi(/.*)?"
semanage fcontext -a -s system_u -t httpd_log_t -r s0 "/var/log/glpi(/.*)?"
# keep httpd_sys_script_rw_t (httpd_var_lib_t prevent dir creation)
semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "/var/lib/glpi(/.*)?"
# files created by app
restorecon -R /etc/glpi
restorecon -R /var/lib/glpi
restorecon -R /var/log/glpi
) &>/dev/null
/sbin/service httpd condrestart > /dev/null 2>&1 || :
POSTUN
/bin/sh
if [ "$1" -eq "0" ]; then
# Remove the File Context
(
semanage fcontext -d "/etc/glpi(/.*)?"
semanage fcontext -d "/var/log/glpi(/.*)?"
semanage fcontext -d "/var/lib/glpi(/.*)?"
) &>/dev/null
fi
/sbin/service httpd condrestart > /dev/null 2>&1 || :