From 200373f48d997eda1aae26c6cb55d2a2a1907291 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 20 Feb 2013 18:57:33 +0000 Subject: [PATCH] ON the MN only start dhcpd if not running if servicenode.dhcpserver set git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15228 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/AAsn.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index daa910036..a0213dc3c 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -520,7 +520,8 @@ sub setup_CONS =head3 setup_DHCP Sets up DHCP services - + If on the Management node, just check if running and if not start it. + On Service nodes do full setup based on site.disjointdhcps setting =cut #----------------------------------------------------------------------------- @@ -530,6 +531,19 @@ sub setup_DHCP my $rc = 0; my $cmd; my $snonly = 0; + # if on the MN check to see if dhcpd is running, and start it if not. + if (xCAT::Utils->isMN()) { # on the MN + my @output = xCAT::Utils->runcmd("service dhcpd status", -1); + if ($::RUNCMD_RC != 0) { # not running + $rc = xCAT::Utils->startService("dhcpd"); + if ($rc != 0) + { + return 1; + } + } + return 0; + } + # read the disjointdhcps attribute to determine if we will setup # dhcp for all nodes or just for the nodes service by this service node my @hs = xCAT::TableUtils->get_site_attribute("disjointdhcps");