You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2017/08/01 18:43:31 UTC

[1/4] incubator-trafodion git commit: [TRAFODION-2692] Fixed monitor startup when hostname is in various forms [TRAFODION-2001] Updated 'sqgen' to not generate script now supported by 'persist' commands.

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master db4e01cd8 -> ed8666d18


[TRAFODION-2692] Fixed monitor startup when hostname is in various forms
[TRAFODION-2001] Updated 'sqgen' to not generate script now supported by 'persist' commands.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/f3293e4f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/f3293e4f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/f3293e4f

Branch: refs/heads/master
Commit: f3293e4feea0d655d1a1560689627706cdc53e89
Parents: e7dedc8
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jul 31 13:49:17 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jul 31 13:49:17 2017 -0700

----------------------------------------------------------------------
 core/sqf/.gitignore                    |   6 +-
 core/sqf/build-scripts/package.exclude |  13 +-
 core/sqf/monitor/linux/clio.cxx        |  21 +-
 core/sqf/monitor/linux/cluster.cxx     | 145 ++++----
 core/sqf/monitor/linux/cluster.h       |   3 +-
 core/sqf/monitor/linux/commaccept.cxx  |  95 ++++--
 core/sqf/monitor/linux/commaccept.h    |   6 +-
 core/sqf/monitor/linux/monitor.cxx     |  43 ++-
 core/sqf/monitor/linux/pnodeconfig.cxx |   4 +-
 core/sqf/monitor/linux/shell.cxx       |  16 +-
 core/sqf/monitor/linux/tctrace.cxx     |  16 +-
 core/sqf/sql/scripts/gensq.pl          | 494 +++++++++-------------------
 core/sqf/sql/scripts/gomon.cold        | 138 ++++++++
 core/sqf/sql/scripts/idtmstart         |  26 ++
 core/sqf/sql/scripts/rmsstart          |  27 ++
 core/sqf/sql/scripts/rmsstop           |  29 ++
 core/sqf/sql/scripts/sqconfig.sample   | 117 -------
 core/sqf/sql/scripts/sqshell           |  29 ++
 core/sqf/sql/scripts/sscpstart         |  28 ++
 core/sqf/sql/scripts/sscpstop          |  27 ++
 core/sqf/sql/scripts/ssmpstart         |  28 ++
 core/sqf/sql/scripts/ssmpstop          |  27 ++
 core/sqf/sql/scripts/tmstart           |  58 ++++
 core/sqf/src/seabed/src/msmon.cpp      |  20 +-
 24 files changed, 831 insertions(+), 585 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/.gitignore
----------------------------------------------------------------------
diff --git a/core/sqf/.gitignore b/core/sqf/.gitignore
index 3b02efa..380ea87 100644
--- a/core/sqf/.gitignore
+++ b/core/sqf/.gitignore
@@ -50,10 +50,10 @@ Linux-x86_64/
 # sqgen / sqstart
 /logs/
 /sqcert/
-/sql/scripts/gomon.*
 /sql/scripts/sqconfig.db
-/sql/scripts/sqipcrm.out
-/sql/scripts/sqshell
+/sql/scripts/*.log
+/sql/scripts/*.out
+/sql/scripts/sqshell.env
 /sql/scripts/sq*.exit_status
 /sql/scripts/stdout_*
 /tmp/

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/build-scripts/package.exclude
----------------------------------------------------------------------
diff --git a/core/sqf/build-scripts/package.exclude b/core/sqf/build-scripts/package.exclude
index 6edeb38..1a56d80 100644
--- a/core/sqf/build-scripts/package.exclude
+++ b/core/sqf/build-scripts/package.exclude
@@ -24,29 +24,18 @@ sql/scripts/DUMPENVS
 sql/scripts/gen_app_file.awk
 sql/scripts/gen_sm_app_file.sh
 sql/scripts/gen_sm_map.sh
-sql/scripts/gomon.cold
-sql/scripts/gomon.warm
 sql/scripts/init_bdr.sql 
 sql/scripts/mon.env
 sql/scripts/monitor
 sql/scripts/rmscheck.sql
-sql/scripts/rmsstart
-sql/scripts/rmsstop
-sql/scripts/shell.env
-sql/scripts/smstart
-sql/scripts/smstop
+sql/scripts/sqshell.env
 sql/scripts/sq_ase.*
 sql/scripts/sq_tse.*
 sql/scripts/sqconfig.db
 sql/scripts/sqipcrm.out
-sql/scripts/sqshell
 sql/scripts/sqstart.exit_status
 sql/scripts/sqstop.exit_status
 sql/scripts/sqstore.sqlci
-sql/scripts/sscpstart
-sql/scripts/sscpstop
-sql/scripts/ssmpstart
-sql/scripts/ssmpstop
 sql/scripts/startHA
 sql/scripts/stopHA
 sql/scripts/stdout*

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/clio.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clio.cxx b/core/sqf/monitor/linux/clio.cxx
index c4c2690..d3034ea 100644
--- a/core/sqf/monitor/linux/clio.cxx
+++ b/core/sqf/monitor/linux/clio.cxx
@@ -362,6 +362,8 @@ Local_IO_To_Monitor::Local_IO_To_Monitor(int pv_pid)
     iv_client_buffers_max=SQ_LIO_MAX_BUFFERS;
 
     char la_node_name[MPI_MAX_PROCESSOR_NAME];
+    char la_short_node_name[MPI_MAX_PROCESSOR_NAME];
+    memset( la_short_node_name, 0, MPI_MAX_PROCESSOR_NAME );
     if (gethostname(la_node_name, MPI_MAX_PROCESSOR_NAME) == -1)
     {
         if (cv_trace)
@@ -377,6 +379,21 @@ Local_IO_To_Monitor::Local_IO_To_Monitor(int pv_pid)
         tmpptr++;
     }
 
+    // Remove the domain portion of the name if any
+    char str1[MPI_MAX_PROCESSOR_NAME];
+    memset( str1, 0, MPI_MAX_PROCESSOR_NAME );
+    strcpy (str1, la_node_name );
+
+    char *str1_dot = strchr( (char *) str1, '.' );
+    if ( str1_dot )
+    {
+        memcpy( la_short_node_name, str1, str1_dot - str1 );
+    }
+    else
+    {
+        strcpy (la_short_node_name, str1 );
+    }
+
     char *lp_nodes = getenv("SQ_VIRTUAL_NODES");
     if (lp_nodes != NULL) 
     {
@@ -423,8 +440,8 @@ Local_IO_To_Monitor::Local_IO_To_Monitor(int pv_pid)
 
         sprintf(ip_port_fname,"%.*s/monitor.port.%s",
                 (int)(sizeof(ip_port_fname)-(sizeof("/monitor.port.")+11
-                                        +strlen(la_node_name))),
-                getenv("MPI_TMPDIR"), la_node_name);
+                                        +strlen(la_short_node_name))),
+                getenv("MPI_TMPDIR"), la_short_node_name);
 
     }
     // Assume nid zero if the global Seabed nid variable is not initialized

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 45f43de..4a26e1c 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -62,6 +62,7 @@ using namespace std;
 #include "pnode.h"
 #include "reqqueue.h"
 #include "zclient.h"
+#include "commaccept.h"
 
 extern bool IAmIntegrating;
 extern bool IAmIntegrated;
@@ -90,6 +91,7 @@ extern CMonStats *MonStats;
 extern CRedirector Redirector;
 extern CMonLog *MonLog;
 extern CHealthCheck HealthCheck;
+extern CCommAccept CommAccept;
 extern CZClient    *ZClient;
 
 extern long next_test_delay;
@@ -344,28 +346,9 @@ void CCluster::NodeReady( CNode *spareNode )
         lnode->Up();
     }
 
-    switch( CommType )
-    {
-        case CommType_InfiniBand:
-            if ( joinComm_ != MPI_COMM_NULL )
-            {
-                MPI_Comm_free( &joinComm_ );
-                joinComm_ = MPI_COMM_NULL;
-            }
-            break;
-        case CommType_Sockets:
-            if ( joinSock_ != -1 )
-            {
-                close(joinSock_);
-                joinSock_ = -1;
-            }
-            break;
-        default:
-            // Programmer bonehead!
-            abort();
-    }
+    ResetIntegratingPNid();
     spareNode->SetActivatingSpare( false );
-    integratingPNid_ = -1;
+
     if ( MyNode->IsCreator() )
     {
         MyNode->SetCreator( false, -1, -1 );
@@ -749,7 +732,22 @@ void CCluster::HardNodeDown (int pnid, bool communicate_state)
         }
         else
         {
-            snprintf(port_fname, sizeof(port_fname), "%s/monitor.port.%s",getenv("MPI_TMPDIR"),node->GetName());
+            // Remove the domain portion of the name if any
+            char my_node_name[MPI_MAX_PROCESSOR_NAME];
+            char str1[MPI_MAX_PROCESSOR_NAME];
+            memset( str1, 0, MPI_MAX_PROCESSOR_NAME );
+            strcpy (str1, node->GetName() );
+        
+            char *str1_dot = strchr( (char *) str1, '.' );
+            if ( str1_dot )
+            {
+                memcpy( my_node_name, str1, str1_dot - str1 );
+            }
+            else
+            {
+                strcpy (my_node_name, str1 );
+            }
+            snprintf(port_fname, sizeof(port_fname), "%s/monitor.port.%s",getenv("MPI_TMPDIR"),my_node_name);
         }
         sprintf(temp_fname, "%s.bak", port_fname);
         remove(temp_fname);
@@ -805,27 +803,7 @@ void CCluster::HardNodeDown (int pnid, bool communicate_state)
         {
             if ( node->GetPNid() == integratingPNid_ )
             {
-                switch( CommType )
-                {
-                    case CommType_InfiniBand:
-                        if ( joinComm_ != MPI_COMM_NULL )
-                        {
-                            MPI_Comm_free( &joinComm_ );
-                            joinComm_ = MPI_COMM_NULL;
-                        }
-                        break;
-                    case CommType_Sockets:
-                        if ( joinSock_ != -1 )
-                        {
-                            close(joinSock_);
-                            joinSock_ = -1;
-                        }
-                        break;
-                    default:
-                        // Programmer bonehead!
-                        abort();
-                }
-                integratingPNid_ = -1;
+                ResetIntegratingPNid();
                 if ( MyNode->IsCreator() )
                 {
                     MyNode->SetCreator( false, -1, -1 );
@@ -1446,27 +1424,7 @@ int CCluster::HardNodeUp( int pnid, char *node_name )
                 }
             }
 
-            switch( CommType )
-            {
-                case CommType_InfiniBand:
-                    if ( joinComm_ != MPI_COMM_NULL )
-                    {
-                        MPI_Comm_free( &joinComm_ );
-                        joinComm_ = MPI_COMM_NULL;
-                    }
-                    break;
-                case CommType_Sockets:
-                    if ( joinSock_ != -1 )
-                    {
-                        close(joinSock_);
-                        joinSock_ = -1;
-                    }
-                    break;
-                default:
-                    // Programmer bonehead!
-                    abort();
-            }
-            integratingPNid_ = -1;
+            ResetIntegratingPNid();
             if ( MyNode->IsCreator() )
             {
                 MyNode->SetCreator( false, -1, -1 );
@@ -2855,7 +2813,19 @@ void CCluster::InitializeConfigCluster( void )
     if ( IsRealCluster )
     {   // Map node name to physical node id
         // (for virtual nodes physical node equals "rank" (previously set))
-        MyPNID = clusterConfig->GetPNid( Node_name );
+        if (MyPNID == -1)
+        {
+            MyPNID = clusterConfig->GetPNid( Node_name );
+            if (MyPNID == -1)
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf(buf, sizeof(buf), "[%s@%d] Can't find node name=%s in cluster configuration\n",
+                         method_name, __LINE__, Node_name );
+                mon_log_write(MON_CLUSTER_INITCONFIGCLUSTER_1, SQ_LOG_CRIT, buf);
+
+                MPI_Abort(MPI_COMM_SELF,99);
+            }
+        }
     }
 
     Nodes->AddNodes( );
@@ -4030,6 +4000,51 @@ void CCluster::ReIntegrateSock( int initProblem )
     TRACE_EXIT;
 }
 
+void CCluster::ResetIntegratingPNid( void )
+{
+    const char method_name[] = "CCluster::ResetIntegratingPNid";
+    TRACE_ENTRY;
+
+    switch( CommType )
+    {
+        case CommType_InfiniBand:
+            if ( joinComm_ != MPI_COMM_NULL )
+            {
+                MPI_Comm_free( &joinComm_ );
+                joinComm_ = MPI_COMM_NULL;
+            }
+            break;
+        case CommType_Sockets:
+            if ( joinSock_ != -1 )
+            {
+                close(joinSock_);
+                joinSock_ = -1;
+            }
+            break;
+        default:
+            // Programmer bonehead!
+            abort();
+    }
+
+    integratingPNid_ = -1;
+    // Indicate to the commAcceptor thread to begin accepting connections
+    CommAccept.setAccepting( true );
+
+    TRACE_EXIT;
+}
+
+void CCluster::SetIntegratingPNid( int pnid ) 
+{
+    const char method_name[] = "CCluster::SetIntegratingPNid";
+    TRACE_ENTRY;
+
+    integratingPNid_ = pnid;
+    // Indicate to the commAcceptor thread to stop accepting connections
+    CommAccept.setAccepting( false );
+
+    TRACE_EXIT;
+}
+
 // Save information about a new communicator for a node that is reintegrating
 void CCluster::addNewComm(int pnid, int otherRank,  MPI_Comm comm)
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.h b/core/sqf/monitor/linux/cluster.h
index 3b8ba20..c7d097b 100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@ -131,7 +131,8 @@ public:
     struct message_def *JoinMessage( const char *node_name, int pnid, JOINING_PHASE phase );
     struct message_def *SpareUpMessage( const char *node_name, int nid );
     struct message_def *ReIntegErrorMessage( const char *msgText );
-    void SetIntegratingNid( int nid ) { integratingPNid_ = nid; };
+    void ResetIntegratingPNid( void );
+    void SetIntegratingPNid( int pnid );
     int HardNodeUp( int pnid, char *node_name );
     inline CNode *GetIntegratingNode() { return Node[integratingPNid_]; }
     inline CNode *GetNode( int pnid ) { return Node[pnid]; }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/commaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/commaccept.cxx b/core/sqf/monitor/linux/commaccept.cxx
index 2855cd3..9867e11 100644
--- a/core/sqf/monitor/linux/commaccept.cxx
+++ b/core/sqf/monitor/linux/commaccept.cxx
@@ -33,6 +33,7 @@ using namespace std;
 #include <signal.h>
 #include <unistd.h>
 
+extern CCommAccept CommAccept;
 extern CMonitor *Monitor;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
@@ -42,7 +43,10 @@ extern char *ErrorMsg (int error_code);
 extern const char *StateString( STATE state);
 extern CommType_t CommType;
 
-CCommAccept::CCommAccept(): shutdown_(false), thread_id_(0)
+CCommAccept::CCommAccept()
+           : accepting_(true)
+           , shutdown_(false)
+           , thread_id_(0)
 {
     const char method_name[] = "CCommAccept::CCommAccept";
     TRACE_ENTRY;
@@ -366,7 +370,7 @@ void CCommAccept::processNewComm(MPI_Comm interComm)
 
         Monitor->SetJoinComm( interComm );
 
-        Monitor->SetIntegratingNid( pnid );
+        Monitor->SetIntegratingPNid( pnid );
 
         Monitor->addNewComm( pnid, 1, intraComm );
 
@@ -454,8 +458,7 @@ void CCommAccept::processNewComm(MPI_Comm interComm)
             node->SetState( State_Down );
 
             MPI_Comm_free ( &interComm );
-            Monitor->SetJoinComm( MPI_COMM_NULL );
-            Monitor->SetIntegratingNid( -1 );
+            Monitor->ResetIntegratingPNid();
         }
         else
         {
@@ -480,8 +483,7 @@ void CCommAccept::processNewComm(MPI_Comm interComm)
                 node->SetState( State_Down ); 
 
                 MPI_Comm_free ( &interComm );
-                Monitor->SetJoinComm( MPI_COMM_NULL );
-                Monitor->SetIntegratingNid( -1 );
+                Monitor->ResetIntegratingPNid();
             }
         }
     }
@@ -708,7 +710,7 @@ void CCommAccept::processNewSock( int joinFd )
 
         Monitor->SetJoinSock( joinFd );
 
-        Monitor->SetIntegratingNid( pnid );
+        Monitor->SetIntegratingPNid( pnid );
 
         // Connect to new monitor
         integratingFd = Monitor->MkCltSock( node->GetSyncPort() );
@@ -747,8 +749,7 @@ void CCommAccept::processNewSock( int joinFd )
 
             node->SetState( State_Down );
             close( joinFd );
-            Monitor->SetJoinSock( -1 );
-            Monitor->SetIntegratingNid( -1 );
+            Monitor->ResetIntegratingPNid();
             return;
         }
 
@@ -772,8 +773,7 @@ void CCommAccept::processNewSock( int joinFd )
                                                    , NULL );
             node->SetState( State_Down );
             close( joinFd );
-            Monitor->SetJoinSock( -1 );
-            Monitor->SetIntegratingNid( -1 );
+            Monitor->ResetIntegratingPNid();
         }
     }
 
@@ -821,16 +821,34 @@ void CCommAccept::commAcceptorIB()
 
     while (true)
     {
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        if (isAccepting())
         {
-            trace_printf("%s@%d - Posting socket accept\n", method_name, __LINE__);
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+            {
+                trace_printf("%s@%d - Posting socket accept\n", method_name, __LINE__);
+            }
+    
+            mem_log_write(CMonLog::MON_CONNTONEWMON_1);
+            interComm = MPI_COMM_NULL;
+            rc = MPI_Comm_accept( MyCommPort, MPI_INFO_NULL, 0, MPI_COMM_SELF,
+                                  &interComm );
+        }
+        else
+        {
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+            {
+                trace_printf("%s@%d - Waiting to post accept\n", method_name, __LINE__);
+            }
+    
+            CLock::lock();
+            CLock::wait();
+            CLock::unlock();
+            if (!shutdown_)
+            {
+                continue; // Ok to accept another connection
+            }
         }
 
-        mem_log_write(CMonLog::MON_CONNTONEWMON_1);
-
-        interComm = MPI_COMM_NULL;
-        rc = MPI_Comm_accept( MyCommPort, MPI_INFO_NULL, 0, MPI_COMM_SELF,
-                              &interComm );
         if (shutdown_)
         {   // We are being notified to exit.
             break;
@@ -877,14 +895,31 @@ void CCommAccept::commAcceptorSock()
 
     while (true)
     {
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        if (isAccepting())
         {
-            trace_printf("%s@%d - Posting accept\n", method_name, __LINE__);
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+            {
+                trace_printf("%s@%d - Posting accept\n", method_name, __LINE__);
+            }
+    
+            mem_log_write(CMonLog::MON_CONNTONEWMON_1);
+            joinFd = Monitor->AcceptCommSock();
+        }
+        else
+        {
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+            {
+                trace_printf("%s@%d - Waiting to post accept\n", method_name, __LINE__);
+            }
+    
+            CLock::lock();
+            CLock::wait();
+            CLock::unlock();
+            if (!shutdown_)
+            {
+                continue; // Ok to accept another connection
+            }
         }
-
-        mem_log_write(CMonLog::MON_CONNTONEWMON_1);
-
-        joinFd = Monitor->AcceptCommSock();
         
         if (shutdown_)
         {   // We are being notified to exit.
@@ -922,6 +957,7 @@ void CCommAccept::shutdownWork(void)
     // Set flag that tells the commAcceptor thread to exit
     shutdown_ = true;   
     Monitor->ConnectToSelf();
+    CLock::wakeOne();
 
     if (trace_settings & TRACE_INIT)
         trace_printf("%s@%d waiting for commAccept thread %lx to exit.\n",
@@ -980,3 +1016,14 @@ void CCommAccept::start()
 
     TRACE_EXIT;
 }
+
+void CCommAccept::setAccepting( bool accepting ) 
+{
+    CAutoLock lock( getLocker( ) );
+    accepting_ = accepting;
+    
+    if ( accepting_ )
+    {
+        CLock::wakeOne();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/commaccept.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/commaccept.h b/core/sqf/monitor/linux/commaccept.h
index 96a1448..ac85efb 100644
--- a/core/sqf/monitor/linux/commaccept.h
+++ b/core/sqf/monitor/linux/commaccept.h
@@ -28,8 +28,9 @@
 
 #include <pthread.h>
 #include <mpi.h>
+#include "lock.h"
 
-class CCommAccept
+class CCommAccept : public CLock
 {
 public:
 
@@ -37,8 +38,10 @@ public:
     virtual ~CCommAccept();
 
     void commAcceptor( void );
+    bool isAccepting( void ) { CAutoLock lock(getLocker()); return( accepting_ ); }
     void processNewComm( MPI_Comm interComm );
     void processNewSock( int sockFd );
+    void setAccepting( bool accepting );
     void start( void );
     void shutdownWork( void );
 
@@ -50,6 +53,7 @@ private:
     bool sendNodeInfoMPI( MPI_Comm interComm );
     bool sendNodeInfoSock( int sockFd );
 
+    bool accepting_;
     bool shutdown_;
 
     // commAccept thread's id

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index d89f4c2..c5dd28b 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -947,10 +947,10 @@ int main (int argc, char *argv[])
     int i;
     int rc;
     bool done = false;
-    bool warmstart = false;
     char *env;
     char *nodename = NULL;
     char fname[MAX_PROCESS_PATH];
+    char short_node_name[MPI_MAX_PROCESSOR_NAME];
     char port_fname[MAX_PROCESS_PATH];
     char temp_fname[MAX_PROCESS_PATH];
     char buf[MON_STRING_BUF_SIZE];
@@ -1079,6 +1079,7 @@ int main (int argc, char *argv[])
     MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
     MPI_Comm_set_errhandler(MPI_COMM_SELF, MPI_ERRORS_RETURN);
     MPI_Comm_rank (MPI_COMM_WORLD, &MyPNID);
+
     MonLog->setPNid( MyPNID );
 
     gethostname(Node_name, MPI_MAX_PROCESSOR_NAME);
@@ -1089,6 +1090,22 @@ int main (int argc, char *argv[])
         tmpptr++;
     }
 
+    // Remove the domain portion of the name if any
+    char str1[MPI_MAX_PROCESSOR_NAME];
+    memset( str1, 0, MPI_MAX_PROCESSOR_NAME );
+    memset( short_node_name, 0, MPI_MAX_PROCESSOR_NAME );
+    strcpy (str1, Node_name );
+
+    char *str1_dot = strchr( (char *) str1, '.' );
+    if ( str1_dot )
+    {
+        memcpy( short_node_name, str1, str1_dot - str1 );
+    }
+    else
+    {
+        strcpy (short_node_name, str1 );
+    }
+
 #ifdef MULTI_TRACE_FILES
     setThreadVariable( (char *)"mainThread" );
 #endif
@@ -1154,6 +1171,16 @@ int main (int argc, char *argv[])
             case CommType_Sockets:
                 if ( isdigit (*argv[3]) )
                 {
+                    // In agent mode and when re-integrating (node up), all
+                    // monitors processes start as a cluster of 1 and join to the 
+                    // creator monitor to establish the real cluster.
+                    // Therefore, MyPNID will always be zero when in and
+                    // it is necessary to use the node name to obtain the correct
+                    // <pnid> from the configuration which occurs when creating the
+                    // CMonitor object down below. By setting MyPNID to -1, when the 
+                    // CCluster::InitializeConfigCluster() invoked during the creation
+                    // of the CMonitor object it will set MyPNID using Node_name.
+                    MyPNID = -1;
                     SMSIntegrating = IAmIntegrating = true;
                     strcpy( IntegratingMonitorPort, argv[3] );
                 }
@@ -1287,8 +1314,6 @@ int main (int argc, char *argv[])
                 , CALL_COMP_GETVERS2(monitor), CommTypeString( CommType ));
     mon_log_write(MON_MONITOR_MAIN_3, SQ_LOG_INFO, buf);
        
-    warmstart = (strcmp(argv[1],"WARM") == 0);
-
 #ifdef DMALLOC
     if (trace_settings & TRACE_INIT)
        trace_printf("%s@%d" "DMALLOC Option set" "\n", method_name, __LINE__);
@@ -1308,6 +1333,7 @@ int main (int argc, char *argv[])
         // This is also used for monitor logs, so start it early. 
         Redirector.start();
 
+        // CNodeContainer loads static configuration from database
         Nodes = new CNodeContainer ();
         Config = new CConfigContainer ();
         Monitor = new CMonitor (procTermSig);
@@ -1336,7 +1362,7 @@ int main (int argc, char *argv[])
         CommAccept.start();
         // Open file used to record process start/end times
         Monitor->openProcessMap ();
- 
+
         // Always using localio now, no other option
         SQ_theLocalIOToClient = new SQ_LocalIOToClient( MyPNID );
         assert (SQ_theLocalIOToClient);
@@ -1364,7 +1390,7 @@ int main (int argc, char *argv[])
         if (IsRealCluster)
         {
             snprintf(port_fname, sizeof(port_fname), "%s/monitor.port.%s",
-                     getenv("MPI_TMPDIR"), Node_name );
+                     getenv("MPI_TMPDIR"), short_node_name );
         }
         else
         {
@@ -1373,6 +1399,13 @@ int main (int argc, char *argv[])
                      getenv("MPI_TMPDIR"),MyPNID,Node_name);
         }
 
+        // Change Node_name what we have in our configuration
+        CNode *myNode = Nodes->GetNode(MyPNID);
+        if (myNode)
+        {
+            strcpy (Node_name, myNode->GetName()); 
+        }
+        
         // create with no caching, user read/write, group read/write, other read
         fd = open( port_fname
                    , O_RDWR | O_TRUNC | O_CREAT | O_DIRECT 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/pnodeconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnodeconfig.cxx b/core/sqf/monitor/linux/pnodeconfig.cxx
index 8526fa6..4d5ee99 100644
--- a/core/sqf/monitor/linux/pnodeconfig.cxx
+++ b/core/sqf/monitor/linux/pnodeconfig.cxx
@@ -409,7 +409,7 @@ int CPNodeConfigContainer::GetPNid( char *nodename )
     CPNodeConfig *config = head_;
     while (config)
     {
-        if ( strcmp( config->GetName(), nodename ) == 0 )
+        if ( hostnamecmp( config->GetName(), nodename ) == 0 )
         { 
             pnid = config->GetPNid();
             break;
@@ -429,7 +429,7 @@ CPNodeConfig *CPNodeConfigContainer::GetPNodeConfig( char *nodename )
     CPNodeConfig *config = head_;
     while (config)
     {
-        if ( strcmp( config->GetName(), nodename ) == 0 )
+        if ( hostnamecmp( config->GetName(), nodename ) == 0 )
         { 
             break;
         }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index b80d2a1..c23c20c 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -808,7 +808,6 @@ bool attach( int nid, char *name, char *program )
     bool attached = false;
     int count;
     MPI_Status status;
-    char filename[MAX_PROCESS_PATH];
     struct message_def *saved_msg = msg;
     const char method_name[] = "attach";
     
@@ -851,15 +850,7 @@ bool attach( int nid, char *name, char *program )
             return true;
         }
     }
-    // Get monitor's port
-    if( getenv("SQ_VIRTUAL_NODES") )
-    {
-        sprintf(filename,"%s/monitor.port.%d.%s",getenv("MPI_TMPDIR"),nid,Node[nid]);
-    }
-    else
-    {
-        sprintf(filename,"%s/monitor.port.%s",getenv("MPI_TMPDIR"),Node[nid]);
-    }
+
     if ( trace_settings & TRACE_SHELL_CMD )
         trace_printf("%s@%d [%s] Attaching to monitor on nid=%d\n",
                      method_name, __LINE__, MyName, nid);
@@ -2758,7 +2749,6 @@ char *get_token (char *cmd, char *token, char *delimiter,
         if (*ptr == '{' 
          || *ptr == '}' 
          || *ptr == ':' 
-         || *ptr == ';' 
          || (*ptr == '-' && isDashDelim)
          || (*ptr == '=' && isEqDelim))
         {
@@ -4146,6 +4136,7 @@ bool persist_process_kill( CPersistConfig *persistConfig )
         {
             // Check monitors state of the target node
             rs = get_node_state( i, NULL, pnid, nodeState, integrating );
+            lnodesCount++;
             if ( rs == false || nodeState != State_Up || integrating )
             {
                 continue;
@@ -4164,7 +4155,6 @@ bool persist_process_kill( CPersistConfig *persistConfig )
                 printf( "Persistent process %s does not exist\n", processName);
                 continue;
             }
-            lnodesCount++;
             kill_process( -1, -1, processName, true );
         }
         break;
@@ -4255,11 +4245,11 @@ bool persist_process_start( CPersistConfig *persistConfig )
         {
             // Check monitors state of the target node
             rs = get_node_state( i, NULL, pnid, nodeState, integrating );
+            lnodesCount++;
             if ( rs == false || nodeState != State_Up || integrating )
             {
                 continue;
             }
-            lnodesCount++;
             get_persist_process_attributes( persistConfig
                                           , i
                                           , process_type

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/monitor/linux/tctrace.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/tctrace.cxx b/core/sqf/monitor/linux/tctrace.cxx
index c5dfe19..d3a0ff9 100644
--- a/core/sqf/monitor/linux/tctrace.cxx
+++ b/core/sqf/monitor/linux/tctrace.cxx
@@ -162,7 +162,10 @@ void CTrafConfigTrace::TraceInit( bool traceEnabled
         }
     }
 
-    remove(trace_file_name);
+    if (!pathnameUsed)
+    {
+        remove(trace_file_name);
+    }
 
     // Get any trace settings that were specified via environment variables
     const char *value;
@@ -178,10 +181,13 @@ void CTrafConfigTrace::TraceInit( bool traceEnabled
         }
     }
 
-    // Get environment variable specifying whether tracing is enabled
-    tracingEnabled_ = GetEnvBool(strTraceEnable_);
-    // Get environment variable value for trace buffer size if specified
-    GetEnvInt(strTraceFileFb_, traceFileFb_);
+    if (!tracingEnabled_)
+    {
+        // Get environment variable specifying whether tracing is enabled
+        tracingEnabled_ = GetEnvBool(strTraceEnable_);
+        // Get environment variable value for trace buffer size if specified
+        GetEnvInt(strTraceFileFb_, traceFileFb_);
+    }
 
     // Convert the user specified trace level string to a number.  The
     // number can be specified as a decimal, octal or hexadecimal

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gensq.pl b/core/sqf/sql/scripts/gensq.pl
index 8cb7769..f2833bf 100755
--- a/core/sqf/sql/scripts/gensq.pl
+++ b/core/sqf/sql/scripts/gensq.pl
@@ -21,12 +21,14 @@
 #
 # @@@ END COPYRIGHT @@@
 #
+use sqconfigdb;
 use sqnodes;
 use sqpersist;
 use POSIX;
 
 # Process types.  Must match values defined by the monitor in msgdef.h.
 my $ProcessType_Undefined = 0;
+my $ProcessType_DTM       = 2;
 my $ProcessType_Generic   = 4;
 my $ProcessType_SSMP      = 11;
 
@@ -91,45 +93,6 @@ sub printIDTMScript {
     print IDTM @rest;
 }
 
-sub printRMSScript {
-    ($dWhich, @rest) = @_;
-    if ($dWhich == 1) {
-       print SSMP @rest;
-       print SSCP @rest;
-    }
-    if ($dWhich == 2) {
-       print SSMP @rest;
-    }
-    if ($dWhich == 3) {
-       print SSCP @rest;
-    }
-    if ($dWhich == 0) {
-       print RMS @rest;
-    }
-}
-
-sub printRMSStopScript{
-    ($dWhich, @rest) = @_;
-    if ($dWhich == 1) {
-       print SSMPS @rest;
-       print SSCPS @rest;
-    }
-    if ($dWhich == 2) {
-       print SSMPS @rest;
-    }
-    if ($dWhich == 3) {
-       print SSCPS @rest;
-    }
-    if ($dWhich == 0) {
-       print RMSS @rest;
-    }
-}
-
-sub printTMScript {
-    ($dWhich, @rest) = @_;
-    print TM @rest;
-}
-
 sub getTime {
     return strftime("%a %b %d %H:%M:%S %Y\n", localtime(time));
 }
@@ -148,26 +111,26 @@ sub printInitialLines {
     printScript(1, "#!/bin/sh \n");
     printTime;
 
-    $smenv = "$ENV{'SQETC_DIR'}/seamonster.env";
-    if ( -e $smenv ) {
-      print "\nThe SeaMonster environment variable file $smenv exists.\n";
-      print "The file will not be re-generated.\n\n";
-    } else {
-      print "\nGenerating SeaMonster environment variable file: $smenv\n\n";
-      #Create SeaMonster environment variable file
-      open (ETC,">>$smenv")
-          or die("unable to open $smenv");
-      if ($bVirtualNodes == 1) {
-          print ETC "SM_VIRTUALNODE=1\n";
-      }
-      if (!$ENV{'SHARED_HARDWARE'} || $ENV{SHARED_HARDWARE} eq 'YES') {
-          print ETC "SM_PIPEDEPTH=6\n";
-          print ETC "SM_LOWATER=3\n";
-          print ETC "SM_BUFFSIZE=102400\n";
-          print ETC "SM_THRESHOLD_NBYTES=51200\n";
-      }
-      close(ETC);
-    }
+#    $smenv = "$ENV{'SQETC_DIR'}/seamonster.env";
+#    if ( -e $smenv ) {
+#      print "\nThe SeaMonster environment variable file $smenv exists.\n";
+#      print "The file will not be re-generated.\n\n";
+#    } else {
+#      print "\nGenerating SeaMonster environment variable file: $smenv\n\n";
+#      #Create SeaMonster environment variable file
+#      open (ETC,">>$smenv")
+#          or die("unable to open $smenv");
+#      if ($bVirtualNodes == 1) {
+#          print ETC "SM_VIRTUALNODE=1\n";
+#      }
+#      if (!$ENV{'SHARED_HARDWARE'} || $ENV{SHARED_HARDWARE} eq 'YES') {
+#          print ETC "SM_PIPEDEPTH=6\n";
+#          print ETC "SM_LOWATER=3\n";
+#          print ETC "SM_BUFFSIZE=102400\n";
+#          print ETC "SM_THRESHOLD_NBYTES=51200\n";
+#      }
+#      close(ETC);
+#    }
 
     $msenv = "$ENV{'SQETC_DIR'}/ms.env";
 
@@ -192,7 +155,6 @@ sub printInitialLines {
            # Allow specific mirroring ON override for virtual node
         print ETC "MS_STREAMS_MIN=20000\n";
         print ETC "MS_STREAMS_MAX=20000\n";
-
     }
     # Cluster
     else {
@@ -214,41 +176,41 @@ sub printInitialLines {
     print ETC "CLASSPATH=$ENV{'CLASSPATH'}:\n";
     close (ETC);
 
-    printScript(1, "\nshell <<eof \n");
-    $gShellStarted=1;
+#    printScript(1, "\nshell <<eof \n");
+#    $gShellStarted=1;
 
-    printScript(1, "\n");
+#    printScript(1, "\n");
 
-    printScript(1, "! Start the monitor processes across the cluster\n");
+#    printScript(1, "! Start the monitor processes across the cluster\n");
 
-    printScript(1, "startup\n");
+#    printScript(1, "startup\n");
 
-    genSQShellExit();
+#    genSQShellExit();
 
-    printScript(1, "\nsqcheckmon\n");
-    printScript(1, "let lv_checkmon_ret=\$\?\n");
-    printScript(1, "if [ \$lv_checkmon_ret '==' 0 ]; then\n");
-    printScript(1, "   echo \"Continuing with the Startup...\"\n");
-    printScript(1, "   echo\n");
-    printScript(1, "else\n");
-    printScript(1, "   echo \"Aborting startup.\"\n");
-    printScript(1, "   more $TRAF_HOME/logs/sqcheckmon.log\n");
-    printScript(1, "   exit 1\n");
-    printScript(1, "fi\n");
+#    printScript(1, "\nsqcheckmon\n");
+#    printScript(1, "let lv_checkmon_ret=\$\?\n");
+#    printScript(1, "if [ \$lv_checkmon_ret '==' 0 ]; then\n");
+#    printScript(1, "   echo \"Continuing with the Startup...\"\n");
+#    printScript(1, "   echo\n");
+#    printScript(1, "else\n");
+#    printScript(1, "   echo \"Aborting startup.\"\n");
+#    printScript(1, "   more \$TRAF_HOME/logs/sqcheckmon.log\n");
+#    printScript(1, "   exit 1\n");
+#    printScript(1, "fi\n");
 
 
-    genSQShellStart();
+#    genSQShellStart();
 
-    if ($bVirtualNodes == 0) {
-        printScript(1, "\nset CLUSTERNAME=\$CLUSTERNAME\n");
-    }
-    printScript(1, "\nset SQ_MBTYPE=$ENV{'SQ_MBTYPE'}\n");
-    printScript(1, "set MY_NODES=\$MY_NODES\n");
+#    if ($bVirtualNodes == 0) {
+#        printScript(1, "\nset CLUSTERNAME=\$CLUSTERNAME\n");
+#    }
+#    printScript(1, "\nset SQ_MBTYPE=$ENV{'SQ_MBTYPE'}\n");
+#    printScript(1, "\nset MY_NODES=\$MY_NODES\n");
 
-    sqconfigdb::addDbClusterData( "SQ_MBTYPE", $ENV{'SQ_MBTYPE'});
-    sqconfigdb::addDbClusterData( "TRAF_HOME", "$TRAF_HOME"); # comes out null
+#    sqconfigdb::addDbClusterData( "SQ_MBTYPE", $ENV{'SQ_MBTYPE'});
+#    sqconfigdb::addDbClusterData( "TRAF_HOME", "$TRAF_HOME"); # comes out null
 
-    genSQShellExit();
+#    genSQShellExit();
 
     $gbInitialLinesPrinted = 1;
 }
@@ -283,169 +245,37 @@ sub printScriptEndLines {
     printScript(1, "exit 0\n");
 }
 
-sub genSQShellExit {
-
-    if ($gShellStarted == 1) {
-        printScript(1, "\n");
-        printScript(1, "exit\n");
-        printScript(1, "eof\n");
-
-        $gShellStarted = 0;
-    }
-}
-
-sub genSQShellStart {
-
-    if ($gShellStarted == 0) {
-        printScript(1, "\n");
-        printScript(1, "sqshell -a <<eof\n");
-
-        $gShellStarted = 1;
-    }
-}
-
-sub genRegWait {
-
-    my $l_registry  = @_[0];
-    my $l_svcname   = @_[1];
-    my $l_duration  = @_[2];
-    my $l_iteration = @_[3];
-
-    printScript(1, "\n");
-    printScript(1, "sqregck -r $l_registry -d $l_duration -i $l_iteration\n");
-    printScript(1, "sqr_stat=\$\?\n");
-    printScript(1, "if \[\[ \$sqr_stat == 0 \]\]; then\n");
-    printScript(1, "\techo \"The $l_svcname is Not Ready yet. Stopping further startup (if any).\"\n");
-    printScript(1, "\texit 1\n");
-    printScript(1, "else\n");
-    printScript(1, "\techo \"The $l_svcname is Ready.\"\n");
-    printScript(1, "fi\n");
-}
-
-sub genComponentTmWait {
-
-    my $l_compname  = @_[0];
-    my $l_duration  = @_[1];
-    my $l_iteration = @_[2];
-
-    printTMScript(1, "\n");
-    printTMScript(1, "sqcheck -c $l_compname -d $l_duration -i $l_iteration -r\n");
-    printTMScript(1, "sq_stat_$l_compname=\$\?\n");
-    printTMScript(1, "if \(\[ \$sq_stat_$l_compname '!=' 0 \] && [ \$sq_stat_$l_compname '!=' 1 \]\); then\n");
-    printTMScript(1, "\techo \"The $l_compname process(es) are Not Ready yet. Stopping further startup (if any).\"\n");
-    printTMScript(1, "\texit 1\n");
-    printTMScript(1, "else\n");
-    printTMScript(1, "\techo \"The $l_compname process(es) are Ready.\"\n");
-    printTMScript(1, "fi\n");
-}
-
-
-sub genIDTMSrv {
-    if ($SQ_IDTMSRV > 0) {
-        printIDTMScript(1, "#!/bin/sh\n");
-        printIDTMScript(1, "# Trafodion config/utility file generated @ ",getTime(),"\n");
-        
-        printIDTMScript(1, "sqshell -c persist exec TMID\n");
-        printIDTMScript(1, "exit $?\n");
+#sub genSQShellExit {
+#
+#    if ($gShellStarted == 1) {
+#        printScript(1, "\n");
+#        printScript(1, "exit\n");
+#        printScript(1, "eof\n");
+#
+#        $gShellStarted = 0;
+#    }
+#}
 
-        printScript(1, "\nidtmstart\n");
-    }
-}
+#sub genSQShellStart {
+#
+#    if ($gShellStarted == 0) {
+#        printScript(1, "\n");
+#        printScript(1, "sqshell -a <<eof\n");
+#
+#        $gShellStarted = 1;
+#    }
+#}
 
-sub genDTM {
-
-    printTMScript(1, "#!/bin/sh\n");
-    printTMScript(1, "# Trafodion config/utility file generated @ ",getTime(),"\n");
- 
-    printTMScript(1, "sqshell -a <<eof\n");
-    printTMScript(1, "\n! Start DTM\n");
-    printTMScript(1, "set DTM_RUN_MODE=2\n");
-    printTMScript(1, "set SQ_AUDITSVC_READY=1\n");
-    printTMScript(1, "set DTM_TLOG_PER_TM=1\n");
-    printTMScript(1, "persist exec DTM\n");
-    printTMScript(1, "delay 5\n");
-    printTMScript(1, "exit\n");
-    printTMScript(1, "eof\n");
-    
-    genComponentTmWait("dtm", 10, 60);
- 
-    printTMScript(1, "sqshell -a <<eof\n");
-    printTMScript(1, "! Generate DTM Event 1\n");
-    printTMScript(1, "event {DTM} 1\n");
-    printTMScript(1, "exit\n");
-    printTMScript(1, "eof\n");
-
-    printTMScript(1, "\n");
-    printTMScript(1, "echo \"Checking whether the transaction service is ready.\"\n");
-    printTMScript(1, "sqr_stat=0\n");
-    printTMScript(1, "while \[\[ \$sqr_stat == 0 \]\];\n");
-    printTMScript(1, "do\n");
-    printTMScript(1, "sqregck -r SQ_TXNSVC_READY -d 5 -i -1\n");
-    printTMScript(1, "sqr_stat=\$\?\n");
-    printTMScript(1, "done\n");
-    printTMScript(1, "echo \"The Transaction Service is Ready.\"\n");
-
-    printScript(1, "\ntmstart\n");
-    printScript(1, "tm_ret=\$?\n");
-    printScript(1, "if [ \$tm_ret != 0 ]; then\n");
-    printScript(1, "exit \$tm_ret\n");
-    printScript(1, "fi\n");
+sub printSQShellCommand {
+    printScript(1, substr($_,1));
 }
 
-sub generateRMS {
-
-    genSQShellExit();
-
-    #Print out run RMS script
-    printScript(1, "\necho \"SQ_START_RMS: \" \$SQ_START_RMS \n");
-    printScript(1, "if [[ \$SQ_START_RMS == \"1\" ]]; then\n");
-    printScript(1, "echo \"Starting RMS\"\n");
-    
-    #generate rmsstart and rmsstop scripts
-    printRMSScript(0, "#!/bin/sh\n");
-    printRMSScript(0, "# Trafodion config/utility file generated @ ",getTime(),"\n");
-    printRMSScript(0, "\n# Start the RMS processes\n");
-    printRMSScript(0, "sscpstart\n");
-    printRMSScript(0, "ssmpstart\n");
-
-    printRMSStopScript(0, "#!/bin/sh\n");
-    printRMSStopScript(0, "# Trafodion config/utility file generated @ ",getTime(),"\n");
-    printRMSStopScript(0, "\n# Stop the RMS processes\n");
-    printRMSStopScript(0, "ssmpstop\n");
-    printRMSStopScript(0, "sscpstop\n");
-    printRMSStopScript(0, "\necho RMS Processes Stopped\n");
-
-    #generate ssmpstart, ssmpstop, sscpstart, sscpstop scripts
-    printRMSScript(1, "#!/bin/sh\n");
-    printRMSScript(1, "# Trafodion config/utility file generated @ ",getTime(),"\n");
-    printRMSScript(2, "\n# Start the SSMP processes\n");
-    printRMSScript(2, "sqshell -c persist exec SSMP\n");
-    printRMSScript(2, "exit \$?\n");
-    printRMSScript(3, "\n# Start the SSCP processes\n");
-    printRMSScript(3, "sqshell -c persist exec SSCP\n");
-    printRMSScript(3, "exit \$?\n");
-
-    printRMSStopScript(1, "#!/bin/sh\n");
-    printRMSStopScript(1, "# Trafodion config/utility file generated @ ",getTime(),"\n");
-    printRMSStopScript(2, "\n# Stop the SSMP processes\n");
-    printRMSStopScript(2, "sqshell -c persist kill SSMP\n");
-    printRMSStopScript(2, "exit \$?\n");
-    printRMSStopScript(3, "\n# Stop the SSCP processes\n");
-    printRMSStopScript(3, "sqshell -c persist kill SSCP\n");
-    printRMSStopScript(3, "exit \$?\n");
-   
-    printRMSScript(1, "\n");
-
-    printScript(1, "rmsstart\n");
-
-    #printScript(1, "\n! delay 5\n");
-
-    printScript(1, "\necho \"Started RMS\"\n");
-    printScript(1, "fi\n");
-}
+sub executeShellCommand {
+    $lv_cmd=substr($_,1);
+    print "Command: $lv_cmd";
+    $lv_cmd_output=`$lv_cmd` ;
+    print $lv_cmd_output;
 
-sub printSQShellCommand {
-    printScript(1, substr($_,1));
 }
 
 
@@ -567,7 +397,7 @@ sub processOverflow {
         elsif(/^hdd/) {
             @hddLine = split(' ',$_);
             if(@hddLine[1]) {
-            push(@g_hddOverflow, @hddLine[1]);
+                push(@g_hddOverflow, @hddLine[1]);
             }
         }
         elsif(/^end overflow/) {
@@ -580,13 +410,13 @@ sub processFloatingIp {
     while (<>) {
         if (/^process/) {
             @this_line = split(/;/, $_);
-        if($#this_line >= 2) {
-            @external_ip = split(/=/,@this_line[2]);
-#            print "external_ip @external_ip\n";
-            if (($#external_ip >= 1) && (@external_ip[0] eq "external-ip")) {
-                $gFloatingExternalIp = @external_ip[1];
-                $gFloatingExternalIp =~ s/\s+$//; # remove trailing spaces, including new-line characters
-#                print "Floating External IP  $gFloatingExternalIp\n";
+            if($#this_line >= 2) {
+                @external_ip = split(/=/,@this_line[2]);
+#                print "external_ip @external_ip\n";
+                if (($#external_ip >= 1) && (@external_ip[0] eq "external-ip")) {
+                    $gFloatingExternalIp = @external_ip[1];
+                    $gFloatingExternalIp =~ s/\s+$//; # remove trailing spaces, including new-line characters
+#                    print "Floating External IP  $gFloatingExternalIp\n";
                 }
             }
         }
@@ -642,18 +472,18 @@ sub processFloatingIp {
             }
         }
         elsif(/^end floating_ip/) {
-#           printf "Floating Node Id : $gFloatingNodeId \n";
-           if ($gFloatingNodeId == -1) {
-               print "Error: floating_ip_node_id not provided. Please check your config file.\n";
-               print "Exiting..\n";
-               exit $BDR_ERROR;
-           }
-           if ($gFloatingExternalIp eq "") {
-               print "Error: bdr_ip_address is not provided, Please check your config file.\n";
-               print "Exiting..\n";
-               exit $BDR_ERROR;
-           }
-           return;
+#            printf "Floating Node Id : $gFloatingNodeId \n";
+            if ($gFloatingNodeId == -1) {
+                print "Error: floating_ip_node_id not provided. Please check your config file.\n";
+                print "Exiting..\n";
+                exit $BDR_ERROR;
+            }
+            if ($gFloatingExternalIp eq "") {
+                print "Error: bdr_ip_address is not provided, Please check your config file.\n";
+                print "Exiting..\n";
+                exit $BDR_ERROR;
+            }
+            return;
         }
     }
 }
@@ -668,91 +498,93 @@ sub printInitLinesAuxFiles {
 
 sub openFiles {
 
-    open (SQS,">$coldscriptFileName")
-        or die("unable to open $coldscriptFileName");
+#    open (SQS,">$coldscriptFileName")
+#        or die("unable to open $coldscriptFileName");
 
-    open (IDTM,">$startIDTM")
-        or die("unable to open $startIDTM");
+#    open (IDTM,">$startIDTM")
+#        or die("unable to open $startIDTM");
 
-    open (TM,">$startTM")
-        or die("unable to open $startTM");
+#    open (TM,">$startTM")
+#        or die("unable to open $startTM");
 
-    open (RMS,">$startRMS")
-        or die("unable to open $startRMS");
+#    open (RMS,">$startRMS")
+#        or die("unable to open $startRMS");
 
-    open (RMSS,">$stopRMS")
-        or die("unable to open $stopRMS");
+#    open (RMSS,">$stopRMS")
+#        or die("unable to open $stopRMS");
 
-    open (SSMP,">$startSSMP")
-        or die("unable to open $startSSMP");
+#    open (SSMP,">$startSSMP")
+#        or die("unable to open $startSSMP");
 
-    open (SSMPS,">$stopSSMP")
-        or die("unable to open $stopSSMP");
+#    open (SSMPS,">$stopSSMP")
+#        or die("unable to open $stopSSMP");
 
-    open (SSCP,">$startSSCP")
-        or die("unable to open $startSSCP");
+#    open (SSCP,">$startSSCP")
+#        or die("unable to open $startSSCP");
 
-    open (SSCPS,">$stopSSCP")
-        or die("unable to open $stopSSCP");
+#    open (SSCPS,">$stopSSCP")
+#        or die("unable to open $stopSSCP");
 
     sqconfigdb::openDb();
 }
 
 sub endGame {
 
-    open (SQSH,">$sqshell")
-        or die("unable to open $sqshell");
-    printInitLinesAuxFiles (SQSH);
-
     if ($bVirtualNodes == 1) {
+        open (SQSH,">$sqshell")
+            or die("unable to open $sqshell");
+        printInitLinesAuxFiles (SQSH);
+
         print SQSH "export SQ_VIRTUAL_NODES=$gdNumNodes\n";
         print SQSH "export SQ_VIRTUAL_NID=0\n";
+
+        close(SQSH);
+
+        print "\nGenerated SQ Shell environment file: $sqshell\n";
+
+        chmod 0700, $sqshell;
     }
-    print SQSH "\nshell \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9\n";
+#    print SQSH "\nshell \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9\n";
 
 
     print "\n";
-    print "Generated SQ startup script file: $coldscriptFileName\n";
-    print "Generated SQ Shell          file: $sqshell\n";
-    print "Generated IDTM Startup      file: $startIDTM\n";
-    print "Generated TM Startup        file: $startTM\n";
-    print "Generated RMS Startup       file: $startRMS\n";
-    print "Generated RMS Stop          file: $stopRMS\n";
-    print "Generated SSMP Startup      file: $startSSMP\n";
-    print "Generated SSMP Stop         file: $stopSSMP\n";
-    print "Generated SSCP Startup      file: $startSSCP\n";
-    print "Generated SSCP Stop         file: $stopSSCP\n";
+#    print "Generated SQ startup script file: $coldscriptFileName\n";
+#    print "Generated IDTM Startup      file: $startIDTM\n";
+#    print "Generated TM Startup        file: $startTM\n";
+#    print "Generated RMS Startup       file: $startRMS\n";
+#    print "Generated RMS Stop          file: $stopRMS\n";
+#    print "Generated SSMP Startup      file: $startSSMP\n";
+#    print "Generated SSMP Stop         file: $stopSSMP\n";
+#    print "Generated SSCP Startup      file: $startSSCP\n";
+#    print "Generated SSCP Stop         file: $stopSSCP\n";
 
-    close(SQS);
-    close(SQSH);
+#    close(SQS);
+#    close(DBZ);
 
-    close(DBZ);
+#    close(RMS);
+#    close(RMSS);
 
-    close(RMS);
-    close(RMSS);
+#    close(SSMP);
+#    close(SSMPS);
 
-    close(SSMP);
-    close(SSMPS);
+#    close(SSCP);
+#    close(SSCPS);
 
-    close(SSCP);
-    close(SSCPS);
 
+#    chmod 0700, $coldscriptFileName;
 
-    chmod 0700, $coldscriptFileName;
 
-    chmod 0700, $sqshell;
+#    chmod 0700, $startIDTM;
+#    chmod 0700, $startTM;
 
-    chmod 0700, $startIDTM;
-    chmod 0700, $startTM;
+#    chmod 0700, $startRMS;
+#    chmod 0700, $stopRMS;
 
-    chmod 0700, $startRMS;
-    chmod 0700, $stopRMS;
+#    chmod 0700, $startSSMP;
+#    chmod 0700, $stopSSMP;
 
-    chmod 0700, $startSSMP;
-    chmod 0700, $stopSSMP;
-
-    chmod 0700, $startSSCP;
-    chmod 0700, $stopSSCP;
+#    chmod 0700, $startSSCP;
+#    chmod 0700, $stopSSCP;
 }
 
 sub doInit {
@@ -764,20 +596,20 @@ sub doInit {
     # remaining args are input files
 
 
-    $startIDTM="idtmstart";
-    $startTM="tmstart";
+#    $startIDTM="idtmstart";
+#    $startTM="tmstart";
 
-    $startRMS="rmsstart";
-    $startSSMP="ssmpstart";
-    $startSSCP="sscpstart";
-    $stopRMS="rmsstop";
-    $stopSSMP="ssmpstop";
-    $stopSSCP="sscpstop";
+#    $startRMS="rmsstart";
+#    $startSSMP="ssmpstart";
+#    $startSSCP="sscpstart";
+#    $stopRMS="rmsstop";
+#    $stopSSMP="ssmpstop";
+#    $stopSSCP="sscpstop";
 
 
-    $coldscriptFileName=sprintf("%s.cold", $scriptFileName);
+#    $coldscriptFileName=sprintf("%s.cold", $scriptFileName);
 
-    $sqshell = "sqshell";
+    $sqshell = "sqshell.env";
 
     $gdNumCpuCores = `cat /proc/cpuinfo | grep "processor" | wc -l`;
 #print "The number of cores is $gdNumCpuCores\n";
@@ -812,6 +644,9 @@ while (<>) {
     elsif (/^%/) {
         printSQShellCommand;
     }
+    elsif (/^!/) {
+        executeShellCommand;
+    }
     else {
         if (/^#/) {
         }
@@ -826,13 +661,6 @@ while (<>) {
 
 #printZoneList;
 
-genIDTMSrv();
-
-genDTM();
-
-generateRMS();
-
-
 printScriptEndLines;
 
 endGame;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/gomon.cold
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gomon.cold b/core/sqf/sql/scripts/gomon.cold
new file mode 100755
index 0000000..3be86ee
--- /dev/null
+++ b/core/sqf/sql/scripts/gomon.cold
@@ -0,0 +1,138 @@
+#!/bin/bash
+#
+#/bin/sh
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+
+if [ -f $TRAF_HOME/sql/scripts/sqshell.env ]; then
+    . $TRAF_HOME/sql/scripts/sqshell.env
+fi
+
+if [[ -z ${TRAF_AGENT} ]]; then
+   echo  "***"
+   echo  "*** Starting Monitor processes"
+   echo  "***"
+
+sqshell <<eof 
+
+! Start the monitor processes across the cluster
+startup
+
+exit
+eof
+else
+   echo  "***"
+   echo  "*** Waiting for Monitor processes to start"
+   echo  "***"
+sqshell <<eof 
+
+! Waiting for the monitor processes to start across the cluster
+delay 15
+
+exit
+eof
+
+sqshell -c node info
+
+fi
+
+sqcheckmon
+let lv_checkmon_ret=$?
+if [ $lv_checkmon_ret '==' 0 ]; then
+   echo "Continuing with the Startup..."
+   echo
+else
+   echo "Aborting startup."
+   more $TRAF_HOME/logs/sqcheckmon.log
+   exit 1
+fi
+
+# If the 'shell.env' file does not exist, we are in a real cluster
+if [ -e $TRAF_HOME/sql/scripts/sqshell.env ]; then
+   sqshell -c set CLUSTERNAME=$CLUSTERNAME
+fi
+
+sqshell -a <<eof
+
+set SQ_MBTYPE=64d
+set MY_NODES=$MY_NODES
+set JAVA_HOME=$JAVA_HOME
+set MY_CLUSTER_ID=$MY_CLUSTER_ID
+set TRAF_FOUNDATION_READY=0
+
+exit
+eof
+
+# Starting TSID
+
+idtmstart
+sqshell -c delay 1
+
+echo  "***"
+echo  "*** Starting Cluster Monitor"
+echo  "***"
+
+cmonstart
+sqshell -c delay 1
+
+echo  "***"
+echo  "*** Starting Node Monitors"
+echo  "***"
+
+nmonstart
+
+echo  "***"
+echo  "*** Starting Distributed Transaction Manager (DTM)"
+echo  "***"
+
+tmstart
+tm_ret=$?
+if [ $tm_ret != 0 ]; then
+   echo "DTM start failed ..."
+   exit $tm_ret
+fi
+
+echo "SQ_START_RMS: " $SQ_START_RMS 
+if [[ $SQ_START_RMS == "1" ]]; then
+   echo "Starting RMS"
+   rmsstart
+   rms_start_status=$?
+   if [[ $rms_start_status != 0 ]]; then
+      echo "RMS start failed ..."
+      exit $rms_start_status
+   fi
+   echo "Started RMS"
+fi
+
+
+echo  "***"
+echo  "*** Trafodion Foundation Services are ready!"
+echo  "***"
+sqshell -a <<eof
+
+set TRAF_FOUNDATION_READY=1
+
+exit
+eof
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/idtmstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/idtmstart b/core/sqf/sql/scripts/idtmstart
new file mode 100755
index 0000000..7471726
--- /dev/null
+++ b/core/sqf/sql/scripts/idtmstart
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+sqshell -c persist exec TMID
+exit $?

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/rmsstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/rmsstart b/core/sqf/sql/scripts/rmsstart
new file mode 100755
index 0000000..a96107a
--- /dev/null
+++ b/core/sqf/sql/scripts/rmsstart
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+# Start the RMS processes
+sscpstart
+ssmpstart

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/rmsstop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/rmsstop b/core/sqf/sql/scripts/rmsstop
new file mode 100755
index 0000000..52bbe33
--- /dev/null
+++ b/core/sqf/sql/scripts/rmsstop
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+# Stop the RMS processes
+ssmpstop
+sscpstop
+
+echo RMS Processes Stopped

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/sqconfig.sample
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig.sample b/core/sqf/sql/scripts/sqconfig.sample
index 533d6b7..0b89554 100644
--- a/core/sqf/sql/scripts/sqconfig.sample
+++ b/core/sqf/sql/scripts/sqconfig.sample
@@ -55,123 +55,6 @@ end node
 
 
 ###############################################################################
-#
-# Section to configure persistent processes
-#
-#
-# PERSIST_PROCESS_KEYS = { <persist-prefix> } [ , <persist-prefix> ] �
-# 
-# { <persist-prefix>_PROCESS_NAME    = {$<string><nid-format>} }
-# [ <persist-prefix>_PROCESS_TYPE    = {DTM|PERSIST|PSD|SSMP|TMID|WDG} ]
-# { <persist-prefix>_PROGRAM_NAME    = {<program-name>} }
-# { <persist-prefix>_REQUIRES_DTM    = {Y|N} } 
-# [ <persist-prefix>_STDOUT          = {<file-name-prefix><nid-format>} ]
-# { <persist-prefix>_PERSIST_RETRIES = {<retries> , <time-window-secs>} }
-# { <persist-prefix>_PERSIST_ZONES   = {<zid-format> [,<zid-format>] . . . }
-#
-# Where <persist-process-prefix> is currently one of the following:
-#     DTM
-#     TMID
-#     SSCP
-#     SSMP
-#     LOB
-#
-# Where <nid-format> is one of the following:
-#     %nid+     is translated to use all the currently configured node-ids, 
-#               0 - n-1 (all <nid>s)
-#     %nid      is translated to use the node-id relative to the _PROCESS_NAME 
-#               node-id %nid
-#
-# Where <zid-format> is one of the following:
-#     %zid+     is translated to use all the currently configured zone-ids, 
-#               0 - n-1 (all <zid>s)
-#     %zid      is translated to use the zone-id relative to the node-id %nid 
-#
-###############################################################################
-begin persist
-
-#
-# The folling process types are persistent and have special process management:
-#    DTM
-#    TMID
-#    SSMP
-#    PSD
-#    WDG
-#
-# Generic persistent processes are of process type
-#    PERSIST
-#
-
-PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG
-#PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG,QMN,LOB
-
-DTM_PROCESS_NAME     = $TM%nid+
-DTM_PROCESS_TYPE     = DTM
-DTM_PROGRAM_NAME     = tm
-DTM_REQUIRES_DTM     = N
-DTM_STDOUT           = stdout_DTM%nid
-DTM_PERSIST_RETRIES  = 2,30
-DTM_PERSIST_ZONES    = %zid
-
-TMID_PROCESS_NAME    = $TMID
-TMID_PROCESS_TYPE    = TMID
-TMID_PROGRAM_NAME    = idtmsrv
-TMID_REQUIRES_DTM    = N
-TMID_STDOUT          = stdout_TMID
-TMID_PERSIST_RETRIES = 2,30
-TMID_PERSIST_ZONES   = %zid+
-
-SSCP_PROCESS_NAME    = $ZSC%nid+
-SSCP_PROCESS_TYPE    = PERSIST
-SSCP_PROGRAM_NAME    = mxsscp
-SSCP_REQUIRES_DTM    = Y
-SSCP_STDOUT          = stdout_ZSC%nid
-SSCP_PERSIST_RETRIES = 10,60
-SSCP_PERSIST_ZONES   = %zid
-
-SSMP_PROCESS_NAME    = $ZSM%nid+
-SSMP_PROCESS_TYPE    = SSMP
-SSMP_PROGRAM_NAME    = mxssmp
-SSMP_REQUIRES_DTM    = Y
-SSMP_STDOUT          = stdout_ZSM%nid
-SSMP_PERSIST_RETRIES = 10,60
-SSMP_PERSIST_ZONES   = %zid
-
-PSD_PROCESS_NAME     = $PSD%nid+
-PSD_PROCESS_TYPE     = PSD
-PSD_PROGRAM_NAME     = pstartd
-PSD_REQUIRES_DTM     = N
-PSD_STDOUT           = stdout_PSD%nid
-PSD_PERSIST_RETRIES  = 10,60
-PSD_PERSIST_ZONES    = %zid
-
-WDG_PROCESS_NAME     = $WDG%nid+
-WDG_PROCESS_TYPE     = WDG
-WDG_PROGRAM_NAME     = sqwatchdog
-WDG_REQUIRES_DTM     = N
-WDG_STDOUT           = stdout_WDG%nid
-WDG_PERSIST_RETRIES  = 10,60
-WDG_PERSIST_ZONES    = %zid
-
-#QMN_PROCESS_NAME    = $ZQM0000
-#QMN_PROCESS_TYPE    = PERSIST
-#QMN_PROGRAM_NAME    = tdm_arkqmm
-#QMN_REQUIRES_DTM    = Y
-#QMN_STDOUT          = stdout_ZQM0000
-#QMN_PERSIST_RETRIES = 10,60
-#QMN_PERSIST_ZONES   = %zid+
-
-#LOB_PROCESS_NAME     = $ZLOB%nid+
-#LOB_PROCESS_TYPE     = PERSIST
-#LOB_PROGRAM_NAME     = mxlobsrvr
-#LOB_REQUIRES_DTM     = Y
-#LOB_STDOUT           = stdout_ZLOB%nid
-#LOB_PERSIST_RETRIES  = 10,60
-#LOB_PERSIST_ZONES    = %zid
-
-end persist
-
-###############################################################################
 # 
 # Note: You could use '%' as the first character on the line followed by
 #       any SQ shell command. All the text would be passed verbatim.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/sqshell
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqshell b/core/sqf/sql/scripts/sqshell
new file mode 100755
index 0000000..4f9e6fe
--- /dev/null
+++ b/core/sqf/sql/scripts/sqshell
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+if [ -f $TRAF_HOME/sql/scripts/sqshell.env ]; then
+    . $TRAF_HOME/sql/scripts/sqshell.env
+fi
+
+shell $1 $2 $3 $4 $5 $6 $7 $8 $9

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/sscpstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sscpstart b/core/sqf/sql/scripts/sscpstart
new file mode 100755
index 0000000..7e28a3e
--- /dev/null
+++ b/core/sqf/sql/scripts/sscpstart
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+# Start the SSCP processes
+sqshell -c persist exec SSCP
+exit $?
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/sscpstop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sscpstop b/core/sqf/sql/scripts/sscpstop
new file mode 100755
index 0000000..ec9cf79
--- /dev/null
+++ b/core/sqf/sql/scripts/sscpstop
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+# Stop the SSCP processes
+sqshell -c persist kill SSCP
+exit $?

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/ssmpstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ssmpstart b/core/sqf/sql/scripts/ssmpstart
new file mode 100755
index 0000000..49d7934
--- /dev/null
+++ b/core/sqf/sql/scripts/ssmpstart
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+# Start the SSMP processes
+sqshell -c persist exec SSMP
+exit $?
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/ssmpstop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/ssmpstop b/core/sqf/sql/scripts/ssmpstop
new file mode 100755
index 0000000..f7664e7
--- /dev/null
+++ b/core/sqf/sql/scripts/ssmpstop
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+# Start the SSMP processes
+sqshell -c persist kill SSMP
+exit $?

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/sql/scripts/tmstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/tmstart b/core/sqf/sql/scripts/tmstart
new file mode 100755
index 0000000..2ca0eac
--- /dev/null
+++ b/core/sqf/sql/scripts/tmstart
@@ -0,0 +1,58 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+
+sqshell -a <<eof
+
+! Start DTM
+set DTM_RUN_MODE=2
+set SQ_AUDITSVC_READY=1
+set DTM_TLOG_PER_TM=1
+set TRAF_TM_LOCKED=0
+persist exec DTM
+delay 5
+exit
+eof
+
+sqcheck -c dtm -d 10 -i 60 -r
+sq_stat_dtm=$?
+if ([ $sq_stat_dtm '!=' 0 ] && [ $sq_stat_dtm '!=' 1 ]); then
+    echo "The dtm process(es) are Not Ready yet. Stopping further startup (if any)."
+    exit 1
+else
+    echo "The dtm process(es) are Ready."
+fi
+sqshell -a <<eof
+! Generate DTM Event 1
+event {DTM} 1
+exit
+eof
+
+echo "Checking whether the transaction service is ready."
+sqr_stat=0
+while [[ $sqr_stat == 0 ]];
+do
+    sqregck -r SQ_TXNSVC_READY -d 5 -i -1
+    sqr_stat=$?
+done
+echo "The Transaction Service is Ready."

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3293e4f/core/sqf/src/seabed/src/msmon.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/msmon.cpp b/core/sqf/src/seabed/src/msmon.cpp
index 2e6a487..311e099 100644
--- a/core/sqf/src/seabed/src/msmon.cpp
+++ b/core/sqf/src/seabed/src/msmon.cpp
@@ -3745,6 +3745,7 @@ void msg_mon_init() {
 int msg_mon_init_attach(const char *pp_where,
                         char       *pp_name) {
     char          la_host_name[MPI_MAX_PROCESSOR_NAME];
+    char          la_short_host_name[MPI_MAX_PROCESSOR_NAME];
     FILE         *lp_file;
     char         *lp_nid;
     char         *lp_nodes;
@@ -3777,14 +3778,29 @@ int msg_mon_init_attach(const char *pp_where,
             trace_where_printf(pp_where, "clearing su-pname\n");
         memset(ga_ms_su_pname, 0, MS_MON_MAX_PROCESS_NAME);
     }
+    memset( la_short_host_name, 0, MPI_MAX_PROCESSOR_NAME );
     gethostname(la_host_name, sizeof(la_host_name));
-    lp_nodes = getenv(gp_ms_env_sq_vnodes);
     char *tmpptr = la_host_name;
     while ( *tmpptr )
     {
         *tmpptr = (char)tolower( *tmpptr );
         tmpptr++;
     }
+    // Remove the domain portion of the name if any
+    char str1[MPI_MAX_PROCESSOR_NAME];
+    memset( str1, 0, MPI_MAX_PROCESSOR_NAME );
+    strcpy (str1, la_host_name );
+
+    char *str1_dot = strchr( (char *) str1, '.' );
+    if ( str1_dot )
+    {
+        memcpy( la_short_host_name, str1, str1_dot - str1 );
+    }
+    else
+    {
+        strcpy (la_short_host_name, str1 );
+    }
+    lp_nodes = getenv(gp_ms_env_sq_vnodes);
     lp_nid = getenv(gp_ms_env_sq_vnid);
     if ((lp_nid != NULL) && *lp_nid)
         lv_nid = atoi(lp_nid);
@@ -3804,7 +3820,7 @@ int msg_mon_init_attach(const char *pp_where,
         sprintf(&lv_file_name,
                 "%s/monitor.port.%s",
                 getenv(gp_ms_env_mpi_tmpdir),
-                la_host_name);
+                la_short_host_name);
         if (gv_ms_trace_mon)
             trace_where_printf(pp_where,
                                "reading %s (not using virtual nodes)\n",


[3/4] incubator-trafodion git commit: Missed one change to sqnodestatus script.

Posted by su...@apache.org.
Missed one change to sqnodestatus script.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/e7ac9acf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/e7ac9acf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/e7ac9acf

Branch: refs/heads/master
Commit: e7ac9acf98d5c1d2ba3f84e08122106793664400
Parents: 9e4630d
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jul 31 22:24:12 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jul 31 22:24:12 2017 -0700

----------------------------------------------------------------------
 core/sqf/sql/scripts/sqnodestatus | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e7ac9acf/core/sqf/sql/scripts/sqnodestatus
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqnodestatus b/core/sqf/sql/scripts/sqnodestatus
index 5229a7e..44dc93f 100755
--- a/core/sqf/sql/scripts/sqnodestatus
+++ b/core/sqf/sql/scripts/sqnodestatus
@@ -82,6 +82,8 @@ sub check_node_status($)
 {
     my $node_id, $node_status;
     my $check_node=shift;
+    my @basenode = split(/\./,$check_node);
+
     #print "node=${check_node}\n";
     my $command="ssh -M -q $sq_mon_ssh_options $check_node hostname 2>&1";
     #print "command=${command}\n";
@@ -92,7 +94,8 @@ sub check_node_status($)
 
     foreach my $check_result(@check_results)
     {
-        if($check_result =~ /^$check_node/)
+        my @baseresult = split(/\./,$check_result);
+        if($baseresult[0] == $basenode[0])
         {
            #print "check_result=${check_result}\n";
            $node_id=$check_node;


[2/4] incubator-trafodion git commit: Code review fixes.

Posted by su...@apache.org.
Code review fixes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9e4630d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9e4630d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9e4630d1

Branch: refs/heads/master
Commit: 9e4630d1d480b5f5e4bdfdf34b58bf4bfea9623f
Parents: f3293e4
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jul 31 19:13:28 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jul 31 19:13:28 2017 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/cluster.cxx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9e4630d1/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 4a26e1c..585ff0a 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -733,21 +733,22 @@ void CCluster::HardNodeDown (int pnid, bool communicate_state)
         else
         {
             // Remove the domain portion of the name if any
-            char my_node_name[MPI_MAX_PROCESSOR_NAME];
+            char short_node_name[MPI_MAX_PROCESSOR_NAME];
             char str1[MPI_MAX_PROCESSOR_NAME];
+            memset( short_node_name, 0, MPI_MAX_PROCESSOR_NAME );
             memset( str1, 0, MPI_MAX_PROCESSOR_NAME );
             strcpy (str1, node->GetName() );
         
             char *str1_dot = strchr( (char *) str1, '.' );
             if ( str1_dot )
             {
-                memcpy( my_node_name, str1, str1_dot - str1 );
+                memcpy( short_node_name, str1, str1_dot - str1 );
             }
             else
             {
-                strcpy (my_node_name, str1 );
+                strcpy (short_node_name, str1 );
             }
-            snprintf(port_fname, sizeof(port_fname), "%s/monitor.port.%s",getenv("MPI_TMPDIR"),my_node_name);
+            snprintf(port_fname, sizeof(port_fname), "%s/monitor.port.%s",getenv("MPI_TMPDIR"),short_node_name);
         }
         sprintf(temp_fname, "%s.bak", port_fname);
         remove(temp_fname);


[4/4] incubator-trafodion git commit: Merge [TRAFODION-2692] PR-1192 Fixed monitor startup when hostname is in various forms

Posted by su...@apache.org.
Merge [TRAFODION-2692] PR-1192 Fixed monitor startup when hostname is in various forms


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/ed8666d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/ed8666d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/ed8666d1

Branch: refs/heads/master
Commit: ed8666d183b94c48d10752851dec681ed90effd0
Parents: db4e01c e7ac9ac
Author: Suresh Subbiah <su...@apache.org>
Authored: Tue Aug 1 18:43:04 2017 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Tue Aug 1 18:43:04 2017 +0000

----------------------------------------------------------------------
 core/sqf/.gitignore                    |   6 +-
 core/sqf/build-scripts/package.exclude |  13 +-
 core/sqf/monitor/linux/clio.cxx        |  21 +-
 core/sqf/monitor/linux/cluster.cxx     | 146 ++++----
 core/sqf/monitor/linux/cluster.h       |   3 +-
 core/sqf/monitor/linux/commaccept.cxx  |  95 ++++--
 core/sqf/monitor/linux/commaccept.h    |   6 +-
 core/sqf/monitor/linux/monitor.cxx     |  43 ++-
 core/sqf/monitor/linux/pnodeconfig.cxx |   4 +-
 core/sqf/monitor/linux/shell.cxx       |  16 +-
 core/sqf/monitor/linux/tctrace.cxx     |  16 +-
 core/sqf/sql/scripts/gensq.pl          | 494 +++++++++-------------------
 core/sqf/sql/scripts/gomon.cold        | 138 ++++++++
 core/sqf/sql/scripts/idtmstart         |  26 ++
 core/sqf/sql/scripts/rmsstart          |  27 ++
 core/sqf/sql/scripts/rmsstop           |  29 ++
 core/sqf/sql/scripts/sqconfig.sample   | 117 -------
 core/sqf/sql/scripts/sqnodestatus      |   5 +-
 core/sqf/sql/scripts/sqshell           |  29 ++
 core/sqf/sql/scripts/sscpstart         |  28 ++
 core/sqf/sql/scripts/sscpstop          |  27 ++
 core/sqf/sql/scripts/ssmpstart         |  28 ++
 core/sqf/sql/scripts/ssmpstop          |  27 ++
 core/sqf/sql/scripts/tmstart           |  58 ++++
 core/sqf/src/seabed/src/msmon.cpp      |  20 +-
 25 files changed, 836 insertions(+), 586 deletions(-)
----------------------------------------------------------------------