]> granicus.if.org Git - icinga2/commitdiff
Only execute chcon if selinux is enabled and use full context
authorDirk Goetz <dirk.goetz@netways.de>
Fri, 4 Dec 2015 14:49:36 +0000 (15:49 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 7 Dec 2015 09:13:40 +0000 (10:13 +0100)
fixes #10773

etc/initsystem/safe-reload

index faac2dbc7a4e33ca76d213f295b87c32295ae3df..afacc9e456ef91a4111ef0467f118fbd7c9149f0 100644 (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