From 8b5457c410fa480047d1d3d30a7b9588bf41881d Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 22 Aug 2011 12:02:08 +0000 Subject: [PATCH] user Utils->SELINUX to check for selinux enabled git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10336 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index ef9ce51b0..131e48077 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -293,18 +293,14 @@ sub process_request { 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) + my $rc=xCAT::Utils->isSELINUX(); + if ($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');