diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 324d8e451..c5ed88fcb 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -667,9 +667,7 @@ sub build_conf { #------------------------------------------------------------------------------- sub start_service { - my $cmd = "service goconserver start"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { + if (xCAT::Utils->startservice("goconserver") != 0) { xCAT::MsgUtils->message("S", "Could not start goconserver service."); return 1; } @@ -694,9 +692,7 @@ sub start_service { #------------------------------------------------------------------------------- sub stop_service { - my $cmd = "service goconserver stop"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { + if (xCAT::Utils->stopservice("goconserver") != 0) { xCAT::MsgUtils->message("S", "Could not stop goconserver service."); return 1; } @@ -721,9 +717,7 @@ sub stop_service { #------------------------------------------------------------------------------- sub stop_conserver_service { - my $cmd = "service conserver stop"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { + if (xCAT::Utils->stopservice("conserver") != 0) { xCAT::MsgUtils->message("S", "Could not stop conserver service."); return 1; } @@ -747,9 +741,7 @@ sub stop_conserver_service { #------------------------------------------------------------------------------- sub restart_service { - my $cmd = "service goconserver restart"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { + if (xCAT::Utils->restartservice("goconserver") != 0) { xCAT::MsgUtils->message("S", "Could not restart goconserver service."); return 1; }