Page 1 of 1

TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Sun Nov 15, 2015 10:38 pm
by Stuart
Hello,

We are running IBM Cognos TM1 10.2 on an AIX Server. A problem we currently have is processes remaining after running our TM1 shutdown script.

Our simple shutdown script, calls shutdown_tm1s.sh waits 2 minutes then executes shutdown_tm1admsrv.sh. For anyone else out there how long do you wait for the shutdown_tm1s.sh script to finish ? Or do you just kill the process rather than sending a interrupt signal?

Here are the contents of the shutdown_tm1s.sh & shutdown_tm1admsrv.sh scripts.

shutdown_tm1s.sh

Code: Select all

ORIGINAL_DIRECTORY=`pwd`
configuration_directory=$1
cd $configuration_directory
normalized_configuration_directory="`pwd`"
cd $ORIGINAL_DIRECTORY
TM1_SERVER_PROCESS_ID=`ps -ef | grep "tm1s.exe -w -z\"$normalized_configuration_directory\"" | grep -v grep | awk '{print $2}'`
echo "Shutdown TM1 Server PID:" $TM1_SERVER_PROCESS_ID
kill -s INT $TM1_SERVER_PROCESS_ID
exit $?
shutdown_tm1admsrv.sh

Code: Select all

TM1_ADMSRV_PROCESS_ID=`ps -e | grep "tm1admsrv.exe" | awk '{print $1}'`
echo "Shutdown TM1 Admin Server PID:" $TM1_ADMSRV_PROCESS_ID
kill $TM1_ADMSRV_PROCESS_ID
exit $?
I suspect the problem relates to the shutdown_tm1s.sh script and the kill -s command, this is a vendor provided script and someone at our organization may have altered it. If anyone could confirm this or provide the script they use, it would be greatly appreciated.

Thanks
Stuart

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Mon Nov 16, 2015 3:52 am
by failurehappening
Hi Stuart

We have the same scripts but running RHEL. Something I have noticed is that the admin server and tm1 instances must all be running as the same user, here that user is called tm1, when different users are running the admin host and tm1 instances I've had problems with the script provided by IBM

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Mon Nov 16, 2015 12:04 pm
by David Usherwood
Based on my Linux experience (so check vs AIX) shouldn't the 'kill' command have a -9 parameter to ensure it really does shut the process down?

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Mon Nov 16, 2015 10:12 pm
by Stuart
David Usherwood wrote:Based on my Linux experience (so check vs AIX) shouldn't the 'kill' command have a -9 parameter to ensure it really does shut the process down?

Code: Select all

kill -s INT $TM1_SERVER_PROCESS_ID
Yeah I think the purpose of the "kill -s INT" is so the application shuts down gracefully. I could remove the -s INT switch for an immediate kill, but I'm assuming this could cause other problems.

I want to know how long others are waiting for the TM1 application to shutdown after executing the shutdown_tm1s.sh script.

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Mon Nov 16, 2015 11:31 pm
by failurehappening
Using the s INT switch means the process will be send a SIGINT signal, the instance should save the data on the way down. If you kill the process with -9 then the process is sent a SIGKILL and the data will not be saved to disk.

The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process, this is comparable to stopping a service in windows

The SIGKILL signal is sent to a process to cause it to terminate immediately (kill). In contrast to SIGTERM and SIGINT, this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal, this is comparable to ending a process in windows.

Can you try doing a save data from inside TM1 first and then seeing if the -s INT switch works in a more timely fashion?

If you're looking for a way to monitor whether the instance has come down properly then you can use the script /opt/ibm/tm1/bin64/status_tm1s.sh to check if the instance has come down yet. This is a script I use to restart and instance on our linux box using cron:\

Code: Select all

#!/bin/bash
# restartinstance.sh

#:${1?"Usage: $0 Instance_Name"}
if [ -z "$1" ] ; then
        echo "Please specify an instance"
        exit 1
fi

#this is needed to laod the environment variables needed for tm1 to run correctly
source /etc/profile.d/oracle11g.sh
source ~/.profile

#Set the instance name
instance=$1
configpath=/tm1/data/$instance/config/


echo "Shutting down instance " $instance

/opt/ibm/tm1/bin64/shutdown_tm1s.sh $configpath

while true; do
        stillrunning=$(/opt/ibm/tm1/bin64/status_tm1s.sh $configpath )
        if [ -n "$stillrunning" ]; then
                sleep 5
                echo "Instance " $instance " is still up"
        else
                echo "Instance is down"
                sleep 15

                mv /tm1/data/$instance/logging/tm1server.log /tm1/data/$instance/logging/tm1server-$(date +"%Y-%m-%d_%H%M").log
                break
        fi
done

echo " Starting up instance"
nohup /opt/ibm/tm1/bin64/startup_tm1s.sh $configpath &
disown
To set this up in cron, switch user to the user that the tm1 instances are running as, then run crontab -e to edit

Code: Select all

sudo su - tm1
crontab -e

This is what I have in my crontab

Code: Select all

MAILTO=""
30 4 * * * /tm1/data/scripts/restart_tm1s.sh arp > /dev/null 2>&1

I set the MAILTO variable to be empty so that the job doesn't try and email the user that it has run,

The next line sets the script to run at 04:30 everyday, sending the output of the script to null

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Mon Nov 16, 2015 11:49 pm
by Stuart
Thanks heaps for that reply failurehappening, I'm in a strange situation where I have access to the AIX server but not the application itself. How would one execute the save data process from within the TM1 application ? Once done what would be a reasonable time to expect tm1s.exe to stop after executing the shutdown_tm1s.sh script? Around 5 minutes ?

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Tue Nov 17, 2015 12:38 am
by failurehappening
If you know the username and password of an admin user and the name of the ti process that is used to save data, you can use runti

"/opt/ibm/tm1/bin64/tm1runti.exe" -Process "Save Data All" -Adminhost "192.168.0.100" -Server "Name Of Your Instance" -CAMNamespace "NAMESPACE" -User "Admin" -pwd "apple"

Our instances can take up to 15 mins to shutdown gracefully if a save data is done as part of the shutdown. It can be down in less than a minute if the save data has already been run.

Re: TM1 Shutdown Script Not Working (Unix Admin Server)

Posted: Tue Nov 17, 2015 1:00 am
by Stuart
failurehappening wrote:If you know the username and password of an admin user and the name of the ti process that is used to save data, you can use runti

"/opt/ibm/tm1/bin64/tm1runti.exe" -Process "Save Data All" -Adminhost "192.168.0.100" -Server "Name Of Your Instance" -CAMNamespace "NAMESPACE" -User "Admin" -pwd "apple"

Our instances can take up to 15 mins to shutdown gracefully if a save data is done as part of the shutdown. It can be down in less than a minute if the save data has already been run.
Thanks, that answers my questions.