From db03b9948d77bfc73151c1539e879e1cd5afdb4a Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 19 Aug 2011 11:55:15 +0000 Subject: [PATCH] added selinux check git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10322 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index d3fc38e49..ef9ce51b0 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -292,7 +292,19 @@ sub process_request { if ($found == 0) { # no search site.domain found xCAT::SvrUtils::sendmsg([0,"Warning:The domain is not defined in a search path or domain path for AIX (in /etc/resolv.conf. Add \"search $domain\" to /etc/resolv.conf and run makedns again."], $callback); } - + # check for selinux disabled + my $selinux="/etc/selinux/config"; + if (-e ($selinux)) { + # check if selinux is disabled + my $disabled="\"SELINUX=disabled\""; + my $cmd="fgrep $disabled $selinux"; + my @output=xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) + { + xCAT::SvrUtils::sendmsg([0,"Warning:SELINUX is not disabled. The makedns command will not be able to generate a complete DNS setup. Disable SELINUX and run the command again."], $callback); + + } + } my $networkstab = xCAT::Table->new('networks',-create=>0); unless ($networkstab) { xCAT::SvrUtils::sendmsg([1,'Unable to enumerate networks, try to run makenetworks'], $callback); } my @networks = $networkstab->getAllAttribs('net','mask','ddnsdomain');