From d53159268cf9e1b8a42679b3286ee910e65d4e43 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 9 Jun 2009 01:16:04 +0000 Subject: [PATCH] setup http service on the service node git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3533 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/AAsn.pm | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index d5f0324dd..4d8bcbb27 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -193,6 +193,16 @@ sub init_plugin { xCAT::Utils->update_xCATSN($service); } + # The nfsserver field in servicenode table + # will also setup http service for Linux + if (xCAT::Utils->isLinux()) + { + $rc = &setup_HTTP($nodename); # setup HTTP + if ($rc == 0) + { + xCAT::Utils->update_xCATSN('http'); + } + } } # @@ -1016,4 +1026,33 @@ sub setup_TFTP return $rc; } + +#----------------------------------------------------------------------------- + +=head3 setup_HTTP + + Sets up HTTP services on Service Node for Linux + +=cut + +#----------------------------------------------------------------------------- +sub setup_HTTP +{ + my ($nodename) = @_; + my $rc = 0; + + if (xCAT::Utils->isLinux()) + { + my $os = xCAT::Utils->osver(); + if ($os =~ /sles.*/) { + $rc = xCAT::Utils->startService("apache2"); + } + else + { + $rc = xCAT::Utils->startService("httpd"); + } + } + return $rc; +} + 1;