From b42bbe0e02573b1b421b9013411e08643b199df5 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 23 Jul 2026 21:33:50 -0300 Subject: [PATCH] fix(goconserver): manage the service via systemd instead of the `service` command Goconserver.pm shells out to `service goconserver start|stop|restart` (and `service conserver stop`). That command is provided by the initscripts package, which is NOT installed on a minimal EL9/EL10 management node -- there, every one of these calls fails with rc!=0. The damaging case is restart_service(). makegocons calls build_conf(), which rewrites /etc/goconserver/server.conf with the cert-enabled configuration (global.ssl_key_file/ssl_cert_file/ssl_ca_cert_file), and then calls restart_service() so the daemon picks it up. When the restart fails, xCAT only logs "Could not restart goconserver service." and the daemon keeps running with the configuration it read at boot -- the packaged default, which has no ssl_* fields. goconserver's TLS is gated on those fields being set (sslEnable stays false), so it silently serves plain HTTP on the api port while Goconserver.pm always talks to it over https. Every subsequent request then dies with SSL connect attempt failed error:0A0000C6:SSL routines::packet length too long so makegocons/makegocons -d report "Failed to send delete request." and the console can never be registered. On EL8 the bug is invisible because initscripts happens to be installed there. Use the xCAT::Utils service helpers (startservice/stopservice/restartservice), which resolve the unit through servicemap() and issue `systemctl ` on systemd hosts, falling back to `service`/`initctl` only where appropriate. This is the same mechanism the rest of the tree (AAsn.pm and friends) already uses for named, dhcpd, nfs and others. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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; }