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 Gunnar Beutner
parent 1c37f5929a
commit bbfc734df4
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