2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 17:46:38 +00:00

Ignore the disable when not installed, not using package checking as we use a fake package there

This commit is contained in:
bxuxa 2019-03-21 16:46:20 +08:00
parent 2386723ddd
commit 0ff9bc0be5

View File

@ -503,11 +503,13 @@ sub is_goconserver_running {
sub switch_goconserver {
my $callback = shift;
# ignore SN as it is handled by AAsn
if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) {
if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) {
my $cmd = "systemctl disable conserver";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
if (-x "/usr/sbin/conserver") {
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
}
}
$cmd = "systemctl enable goconserver";
xCAT::Utils->runcmd($cmd, -1);
@ -537,9 +539,11 @@ sub switch_conserver {
# ignore SN as it is handled by AAsn
if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) {
my $cmd = "systemctl disable goconserver";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
if (-x "/usr/bin/goconserver") {
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
}
}
$cmd = "systemctl enable conserver";
xCAT::Utils->runcmd($cmd, -1);