From 89c458d8e94fe704cce9c776fc527748f10a70ab Mon Sep 17 00:00:00 2001 From: nott Date: Wed, 24 Mar 2010 15:15:08 +0000 Subject: [PATCH] Add check before calling rmitab for xcatd. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5576 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatconfig | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 59c63c0b3..b326bd5ba 100644 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -280,9 +280,19 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL) system($mkssys_cmd); use strict; - # for AIX systems add xcatd to the /etc/inittab file - my $rmitab_cmd = "rmitab xcatd"; - system($rmitab_cmd); + # + # for AIX systems add xcatd to the /etc/inittab file + # + + # first remove any existing xcatd entry + my $rcmd = "/bin/cat /etc/inittab | grep 'xcatd'"; + my $outref = xCAT::Utils->runcmd("$rcmd", -1); + if ($::RUNCMD_RC == 0) { + my $rmitab_cmd = "rmitab xcatd > /dev/null 2>&1"; + system($rmitab_cmd); + } + + # now create a new entry my $mkitab_cmd = "mkitab \"xcatd:2:once:$::XCATROOT/sbin/restartxcatd > /dev/console 2>&1\" > /dev/null 2>&1"; my $rc = system($mkitab_cmd);