blob: cbb3d11b47f63d80699a053a3c4d1eeb00189786 [file] [log] [blame]
#!/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 @@@
export TRAF_CONFIG=/etc/trafodion/trafodion_config
source $TRAF_CONFIG
rm $TRAF_HOME/logs/securityErrors.txt 2>/dev/null
if [[ "$all_node_count" -eq "1" ]]; then
STARTING_NODE=$NODE_LIST
else
STARTING_NODE=$(echo $MY_NODES | awk '{print $2}')
fi
#==========================================
echo "***INFO: Starting Trafodion instance, if not already started" | tee -a $TRAF_HOME/logs/securityErrors.txt
ssh $STARTING_NODE "cd $TRAF_HOME/sql/scripts; sqstart"
SQSTART_RC=$?
if [ "$SQSTART_RC" -ne "0" -a "$SQSTART_RC" -ne "1" ]; then
echo "***ERROR: sqstart failed with RC=$SQSTART_RC. Check $TRAF_HOME/sqmon.log file for details." | tee -a $TRAF_HOME/logs/securityErrors.txt
exit -1;
fi
# Do initialize authorization and alter predefined users
echo "***INFO: Initialize authorization and set up predefined users" | tee -a $TRAF_HOME/logs/securityErrors.txt
ssh $STARTING_NODE "cd $TRAF_HOME/sql/scripts; echo \"initialize authorization; alter user DB__ROOT set external name \"$DB_ROOT_NAME\";\" | sqlci" | tee -a $TRAF_HOME/logs/securityErrors.txt
foundError=$(grep "ERROR" $TRAF_HOME/logs/securityErrors.txt | wc -l)
if [ "$foundError" -ge "1" ];then
echo "***ERROR: Security installation failed, continuing. Check files $TRAF_HOME/logs/securityErrors.txt for details." | tee -a $TRAF_HOME/logs/securityErrors.txt
fi
echo "***INFO: Please check the install log $TRAF_HOME/logs/securityErrors.txt for any issues" | tee -a $TRAF_HOME/logs/securityErrors.txt
#==========================================
echo "***INFO: Installation setup completed successfully." | tee -a $TRAF_HOME/logs/securityErrors.txt