From e4390308bc458837b6b984c945ca5918d765abd9 Mon Sep 17 00:00:00 2001 From: ellen56 Date: Thu, 19 Mar 2009 07:57:02 +0000 Subject: [PATCH] fix bug 2688297 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2938 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/conserver.pm | 26 +++++++++---- xCAT-server/sbin/xcatconfig | 45 +++++++++++++++++++++++ 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index a716ce43f..59089468c 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -348,14 +348,26 @@ sub makeconservercf { if (!$svboot) { #restart conserver daemon my $cmd; - if (-f "/var/run/conserver.pid") { - $cmd = "/etc/init.d/conserver stop"; - xCAT::Utils->runcmd($cmd, 0); - $cmd = "/etc/init.d/conserver start"; - xCAT::Utils->runcmd($cmd, 0); + if(xCAT::Utils->isAIX()){ + if (-f "/var/run/conserver.pid") { + $cmd = "stopsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "startsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + } else { + $cmd = "startsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + } } else { - $cmd = "/etc/init.d/conserver start"; - xCAT::Utils->runcmd($cmd, 0); + if (-f "/var/run/conserver.pid") { + $cmd = "/etc/init.d/conserver stop"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "/etc/init.d/conserver start"; + xCAT::Utils->runcmd($cmd, 0); + } else { + $cmd = "/etc/init.d/conserver start"; + xCAT::Utils->runcmd($cmd, 0); + } } } } diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 107e61157..19b94ade6 100644 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -574,6 +574,51 @@ if (!-d "/var/log/consoles") } } +if ($::osname eq 'AIX') +{ + if(!-f "/usr/sbin/conserver") + { + my $cmd = "ln -sf /opt/freeware/sbin/conserver /usr/sbin/conserver"; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message('E', "Could not ln -sf /opt/freeware/sbin/conserver /usr/sbin/conserver.\n"); + } + else + { + xCAT::MsgUtils->message('I', "ln -sf /opt/freeware/sbin/conserver /usr/sbin/conserver.\n"); + } + } + if(!-f "/usr/bin/console") + { + $cmd = "ln -sf /opt/freeware/bin/console /usr/bin/console"; + $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message('E', "Could not ln -sf /opt/freeware/bin/console /usr/bin/console.\n"); + } + else + { + xCAT::MsgUtils->message('I', "ln -sf /opt/freeware/bin/console /usr/bin/console.\n"); + } + } + + $cmd = "lssrc -a | grep conserver"; + $outref = xCAT::Utils->runcmd("$cmd", 0); + unless($outref =~ /conserver/) + { + $cmd = "mkssys -p /opt/freeware/sbin/conserver -s conserver -u 0 -S -n 15 -f 15 -a \"-o -O1 -C /etc/conserver.cf\""; + $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message('E', "Could not add subsystem conserver.\n"); + } + else + { + xCAT::MsgUtils->message('I', "Add subsystem conserver.\n"); + } + } +} # some Linux-only config if ($::osname eq 'Linux') {