From bbfc734df4530f6a162d8ca11d80d887a2b3ef22 Mon Sep 17 00:00:00 2001 From: Dirk Goetz Date: Fri, 4 Dec 2015 15:49:36 +0100 Subject: [PATCH] Only execute chcon if selinux is enabled and use full context fixes #10773 --- etc/initsystem/safe-reload | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/initsystem/safe-reload b/etc/initsystem/safe-reload index faac2dbc7..afacc9e45 100644 --- a/etc/initsystem/safe-reload +++ b/etc/initsystem/safe-reload @@ -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