diff --git a/oam/install_scripts/binary_installer.sh b/oam/install_scripts/binary_installer.sh index dbfeae516..997cd7ff4 100644 --- a/oam/install_scripts/binary_installer.sh +++ b/oam/install_scripts/binary_installer.sh @@ -210,6 +210,51 @@ expect { } send_user "\n" +# +# copy over custom OS tmp files +# +send_user "Copy Custom OS files to Module " +send_user " \n" +send "scp -rv $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 60 +expect { + "Exit status 0" { send_user "DONE" } + "scp :" { send_user "ERROR\n" ; + send_user "\n*** Installation ERROR\n" ; + exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + timeout { send_user "ERROR: Timeout\n" ; exit 1 } +} +send_user "\n" + +# +# copy over MariaDB Columnstore Module file +# +send_user "Copy MariaDB Columnstore Module file to Module " +send "scp -v $INSTALLDIR/local/etc/$MODULE/* $USERNAME@$SERVER:$INSTALLDIR/local/.\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 60 +expect { + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "Exit status 0" { send_user "DONE" } + "Exit status 1" { send_user "ERROR: scp failed" ; exit 1 } + timeout { send_user "ERROR: Timeout to host\n" ; exit 1 } +} +send_user "\n" + send_user "Run post-install script " send_user " \n" send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/post-install --installdir=$INSTALLDIR'\n" @@ -247,26 +292,6 @@ expect { } send_user "\n" -if { $AMAZONINSTALL == "1" } { - # - # copy over customer OS files - # - send_user "Copy MariaDB Columnstore OS files to Module " - send_user " \n" - send "scp -v -r $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n" - if { $PASSWORD != "ssh" } { - set timeout 30 - expect { - "word: " { send "$PASSWORD\n" } - "passphrase" { send "$PASSWORD\n" } - } - } - set timeout 60 - expect { - "Exit status 0" { send_user "DONE" } - } -} - send_user "\nInstallation Successfully Completed on '$MODULE'\n" exit 0 diff --git a/oam/install_scripts/module_installer.sh b/oam/install_scripts/module_installer.sh index f296750bc..c989865e3 100755 --- a/oam/install_scripts/module_installer.sh +++ b/oam/install_scripts/module_installer.sh @@ -57,9 +57,11 @@ ServerTypeInstall=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTyp cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud` if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then + echo "Amazon setup on Module" cp $COLUMNSTORE_INSTALL_DIR/local/etc/credentials $HOME/.aws/. > /dev/null 2>&1 sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local - + sudo chmod 777 /etc/rc.d/rc.local + if [ $module = "pm" ]; then if test -f $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab ; then echo "Setup fstab on Module" diff --git a/oam/install_scripts/package_installer.sh b/oam/install_scripts/package_installer.sh index 038486884..498df9a4b 100644 --- a/oam/install_scripts/package_installer.sh +++ b/oam/install_scripts/package_installer.sh @@ -252,7 +252,76 @@ expect { "Exit status 0" { send_user "DONE" } timeout { send_user "ERROR: Timeout to host\n" ; exit 1 } } +send_user "\n" +# +# copy over calpont config file +# +send_user "Copy MariaDB Columnstore Config file to Module " +send_user " \n" +send date\n +send "scp -v $INSTALLDIR/etc/* $USERNAME@$SERVER:$INSTALLDIR/etc\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 60 +expect { + "Exit status 0" { send_user "DONE" } + "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } +} +send_user "\n" + +# +# copy over custom OS tmp files +# +send_user "Copy Custom OS files to Module " +send_user " \n" +send "scp -rv $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 60 +expect { + "Exit status 0" { send_user "DONE" } + "scp :" { send_user "ERROR\n" ; + send_user "\n*** Installation ERROR\n" ; + exit 1 } + "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1} + timeout { send_user "ERROR: Timeout\n" ; exit 1 } +} +send_user "\n" + +# +# copy over MariaDB Columnstore Module file +# +send_user "Copy MariaDB Columnstore Module file to Module " +send "scp -v $INSTALLDIR/local/etc/$MODULE/* $USERNAME@$SERVER:$INSTALLDIR/local/.\n" +if { $PASSWORD != "ssh" } { + set timeout 30 + expect { + "word: " { send "$PASSWORD\n" } + "passphrase" { send "$PASSWORD\n" } + } +} +set timeout 60 +expect { + "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "Exit status 0" { send_user "DONE" } + "Exit status 1" { send_user "ERROR: scp failed" ; exit 1 } + timeout { send_user "ERROR: Timeout to host\n" ; exit 1 } +} send_user "\n" send_user "Start ColumnStore service " @@ -274,27 +343,6 @@ expect { send_user "\n" -if { $AMAZONINSTALL == "1" } { - # - # copy over customer OS files - # - send_user "Copy MariaDB Columnstore OS files to Module " - send_user " \n" - send "scp -v -r $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n" - if { $PASSWORD != "ssh" } { - set timeout 30 - expect { - "word: " { send "$PASSWORD\n" } - "passphrase" { send "$PASSWORD\n" } - } - } - - set timeout 60 - expect { - "Exit status 0" { send_user "DONE" } - } -} - send_user "\nInstallation Successfully Completed on '$MODULE'\n" exit 0 diff --git a/oamapps/mcsadmin/mcsadmin.cpp b/oamapps/mcsadmin/mcsadmin.cpp index 61b210241..27fd7e816 100644 --- a/oamapps/mcsadmin/mcsadmin.cpp +++ b/oamapps/mcsadmin/mcsadmin.cpp @@ -2428,8 +2428,8 @@ int processCommand(string* arguments) } } } - - sleep(10); + //this is here because a customer likes doing a shutdownsystem then startsystem in a script + sleep(5); } break; diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index b416378ce..770df1adc 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -1072,6 +1072,7 @@ int main(int argc, char *argv[]) // setup to start on reboot system("sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1"); + system("sudo chmod 777 /etc/rc.d/rc.local >/dev/null 2>&1"); } if ( pmwithum ) @@ -5022,7 +5023,7 @@ bool makeModuleFile(string moduleName, string parentOAMModuleName) if ( moduleName == parentOAMModuleName) fileName = installDir + "/local/module"; else - return true; + fileName = installDir + "/local/etc/" + moduleName + "/module"; unlink (fileName.c_str()); ofstream newFile (fileName.c_str()); diff --git a/procmon/main.cpp b/procmon/main.cpp index a5958ad3e..570dea6f9 100644 --- a/procmon/main.cpp +++ b/procmon/main.cpp @@ -162,8 +162,9 @@ int main(int argc, char **argv) } //re-read local system info with updated Columnstore.xml -// sleep(1); -// MonitorConfig config; + sleep(1); + Config* sysConfig = Config::makeConfig(); + MonitorConfig config; //PMwithUM config try { @@ -977,23 +978,33 @@ static void messageThread(MonitorConfig config) Oam oam; string msgPort = config.moduleName() + "_ProcessMonitor"; - - //ProcMon will wait for request + string port = ""; + + //ProcMon will wait for request IOSocket fIos; + Config* sysConfig = Config::makeConfig(); //read and cleanup port before trying to use try { - Config* sysConfig = Config::makeConfig(); - string port = sysConfig->getConfig(msgPort, "Port"); - string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1"; - if ( !rootUser) - cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1"; - - system(cmd.c_str()); + port = sysConfig->getConfig(msgPort, "Port"); } catch(...) + {} + + //check if enter doesnt exist, if not use pm1's + if (port.empty() or port == "" ) { + msgPort = "pm1_ProcessMonitor"; + port = sysConfig->getConfig(msgPort, "Port"); } + + log.writeLog(__LINE__, "PORTS: " + msgPort + "/" + port, LOG_TYPE_DEBUG); + + string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1"; + if ( !rootUser) + cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1"; + + system(cmd.c_str()); for (;;) { @@ -1043,14 +1054,14 @@ static void messageThread(MonitorConfig config) catch (exception& ex) { string error = ex.what(); -// log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": " + error, LOG_TYPE_ERROR); + log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": " + error, LOG_TYPE_ERROR); // takes 2 - 4 minites to free sockets, sleep and retry sleep(1); } catch(...) { -// log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": Caught unknown exception!", LOG_TYPE_ERROR); + log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": Caught unknown exception!", LOG_TYPE_ERROR); // takes 2 - 4 minites to free sockets, sleep and retry sleep(1);