Only execute chcon if selinux is enabled and use full context

fixes #10773
This commit is contained in:
Dirk Goetz 2015-12-04 15:49:36 +01:00 committed by Michael Friedrich
parent ba1cc1c5fa
commit c7c3cceba8
1 changed files with 4 additions and 2 deletions

View File

@ -12,8 +12,10 @@ printf "Validating config files: "
OUTPUTFILE=`mktemp`
if type chcon >/dev/null 2>&1; then
chcon -t icinga2_tmp_t $OUTPUTFILE
if type selinuxenabled >/dev/null 2>&1; then
if selinuxenabled; then
chcon -t icinga2_tmp_t $OUTPUTFILE
fi
fi
if ! $DAEMON daemon --validate --color > $OUTPUTFILE; then