- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Startup Script to automatically start TSM deamon
Operating System - HP-UX
1752815
Members
6077
Online
108789
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2011 12:06 AM
тАО03-08-2011 12:06 AM
Startup Script to automatically start TSM deamon
Hi All, can anyone provide me a script to automatically recycle the TSM Client dsmc scheduler deamon?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2011 05:19 PM
тАО03-08-2011 05:19 PM
Re: Startup Script to automatically start TSM deamon
Do you have problems with the daemon where it crashes or stops running? The brute force way to fix this is to put the program's startup command in /etc/inittab and then specifying :respawn: as the action.
Bill Hassell, sysadmin
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2011 03:05 AM
тАО03-10-2011 03:05 AM
Re: Startup Script to automatically start TSM deamon
I have the below script:
#!/usr/bin/sh
cd /
/sbin/init.d/tsm_client &
ssh servername /sbin/init.d/tsm_client &
sleep 5
echo ===============================
echo servername2
ps -ef|grep dsm
echo ===============================
echo servername
ssh servername ps -ef|grep dsm
How can I run these commands as HP-UX boots?
#!/usr/bin/sh
cd /
/sbin/init.d/tsm_client &
ssh servername /sbin/init.d/tsm_client &
sleep 5
echo ===============================
echo servername2
ps -ef|grep dsm
echo ===============================
echo servername
ssh servername ps -ef|grep dsm
How can I run these commands as HP-UX boots?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2011 04:54 AM
тАО03-10-2011 04:54 AM
Re: Startup Script to automatically start TSM deamon
This appears to be a start sequence for Tivoli and it appears that tsm_client is already in the correct location (/sbin/init.d). If the tsm_client script was written correctly, there is no reason to run the script in the background (it will always complete and should leave processes running). To see what the tsm_client did during bootup, look at /etc/rc.log.
The correct way to start tsm_client is to place a symbolic link in the /sbin/rc3.d directory, one starting with "S###" and the second link starting with "K###". The alphabetical listing of the links in rc3.d shows the order in which the S(start) scripts will run on bootup and the K(kill) scripts will run at shutdown.
The next line in your script indicates that the same script is to be run on a remote server. This seems a bit strange since I assume you have the tsm_client run during bootup on the remote machine too. Just add the symbolic links to the remote system and check the remote machine's /etc/rc.log for status. This is the normal way to start and stop applications at bootup and shutdown.
If you need to verify that a process is running, use the exact match capability of ps:
UNIX95=1 ps -fC dsm
Type the command line exactly as shown -- UNIX95=1 temporarily sets a flag for ps to use additional options. -C dsm will only find dsm and not dsm1123 or abcdsm (which is the mistake grep will make). The same is true for both local and remote commands.
So it appears that your script is required because tsm_cient is not always starting and nobody is being notified when it doesn't work. I would write a boot check script something like this:
#!/usr/bin/sh
set -u
export PATH=/usr/bin
case $1 in
'start_msg')
echo "Checking tsm_client"
exit 0
;;
'start')
CMD='UNIX95=1 ps -C dsm > /dev/null 2>&1'
# Check Tivoli locally
eval "$CMD"
RTN1=$?
if [ $RTN1 -ne 0 ]
then
echo "Check /etc/rc.log" |
mailx -s "tsm_client not running"
sysadmin@mycompany.com
fi
# Check tsm_client remotely
SERVER=servername2
ssh -n $SERVER "$CMD"
RTN2=$?
if [ $RTN2 -ne 0 ]
then
echo "Check /etc/rc.log on $SERVER" |
mailx -s "tsm_client not running at $SERVER"
sysadmin@mycompany.com
fi
if [ $ RTN1 -ne 0 ]] && exit 1
if [ $ RTN2 -ne 0 ]] && exit 1
exit 0
;;
esac
The 2 conditions in the case statement are required for all start/stop scripts. The ps command is given the UNIX95 variable to enable the -C option, but we don't need any details like -f. Instead, ps returns 0 if one or more processes with that name are found, or 1 if the process is not found. ssh -n is used when running non-interactive commands.
Place this script in /sbin/init.d with a name like tsm_check. Then make a link in /sbin/rc3.d something like:
ln -s /sbin/init.d/tsm_check /sbin/rc3.d/S999tsm_check
Bill Hassell, sysadmin
The correct way to start tsm_client is to place a symbolic link in the /sbin/rc3.d directory, one starting with "S###" and the second link starting with "K###". The alphabetical listing of the links in rc3.d shows the order in which the S(start) scripts will run on bootup and the K(kill) scripts will run at shutdown.
The next line in your script indicates that the same script is to be run on a remote server. This seems a bit strange since I assume you have the tsm_client run during bootup on the remote machine too. Just add the symbolic links to the remote system and check the remote machine's /etc/rc.log for status. This is the normal way to start and stop applications at bootup and shutdown.
If you need to verify that a process is running, use the exact match capability of ps:
UNIX95=1 ps -fC dsm
Type the command line exactly as shown -- UNIX95=1 temporarily sets a flag for ps to use additional options. -C dsm will only find dsm and not dsm1123 or abcdsm (which is the mistake grep will make). The same is true for both local and remote commands.
So it appears that your script is required because tsm_cient is not always starting and nobody is being notified when it doesn't work. I would write a boot check script something like this:
#!/usr/bin/sh
set -u
export PATH=/usr/bin
case $1 in
'start_msg')
echo "Checking tsm_client"
exit 0
;;
'start')
CMD='UNIX95=1 ps -C dsm > /dev/null 2>&1'
# Check Tivoli locally
eval "$CMD"
RTN1=$?
if [ $RTN1 -ne 0 ]
then
echo "Check /etc/rc.log" |
mailx -s "tsm_client not running"
sysadmin@mycompany.com
fi
# Check tsm_client remotely
SERVER=servername2
ssh -n $SERVER "$CMD"
RTN2=$?
if [ $RTN2 -ne 0 ]
then
echo "Check /etc/rc.log on $SERVER" |
mailx -s "tsm_client not running at $SERVER"
sysadmin@mycompany.com
fi
if [ $ RTN1 -ne 0 ]] && exit 1
if [ $ RTN2 -ne 0 ]] && exit 1
exit 0
;;
esac
The 2 conditions in the case statement are required for all start/stop scripts. The ps command is given the UNIX95 variable to enable the -C option, but we don't need any details like -f. Instead, ps returns 0 if one or more processes with that name are found, or 1 if the process is not found. ssh -n is used when running non-interactive commands.
Place this script in /sbin/init.d with a name like tsm_check. Then make a link in /sbin/rc3.d something like:
ln -s /sbin/init.d/tsm_check /sbin/rc3.d/S999tsm_check
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP