diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index 049831309..3ec742830 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -185,6 +185,13 @@ sub isServiceReq if (!exists($servicehash->{'tftpserver'})) { $servicehash->{'tftpserver'} = 1; } + # On Ubuntu management node, we disabled the isc-dhcp-server in upstart, + # through file /etc/init/isc-dhcp-server.override, see bug 4399 + # however, this causes a new problem, bug 4515 + # the fix is to start dhcp server when starting xcatd + if (!exists($servicehash->{'dhcpserver'}) && xCAT::Utils->osver() =~ /ubuntu.*/i) { + $servicehash->{'dhcpserver'} = 1; + } } $servicenodetab->close; diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 953a4f658..0b4d03392 100755 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -544,9 +544,13 @@ sub setup_DHCP if (xCAT::Utils->isMN()) { # on the MN #my @output = xCAT::Utils->runcmd("service dhcpd status", -1); #if ($::RUNCMD_RC != 0) { # not running - my $retcode= xCAT::Utils->checkservicestatus("dhcpd"); + my $dhcpservice = "dhcpd"; + if (-e "/etc/init.d/isc-dhcp-server") { #Ubuntu + $dhcpservice = "isc-dhcp-server"; + } + my $retcode= xCAT::Utils->checkservicestatus($dhcpservice); if($retcode!=0){ - $rc = xCAT::Utils->startservice("dhcpd"); + $rc = xCAT::Utils->startservice($dhcpservice); if ($rc != 0) { return 1;