- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Auto Start script question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
12-20-2003 03:09 PM
12-20-2003 03:09 PM
I grabbed one of the auto start scripts from /sbin/init.d and altered it to start Tivoli upon reboot for me. My problem is that when it starts, it writes the backup log to the /etc/rc.log which I do not want. It also logs in the proper placedsmsched.log), I don't need the logging in the rc.log.
Thanks in advance for any help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2003 04:17 PM
12-20-2003 04:17 PM
Re: Auto Start script question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2003 05:32 PM
12-20-2003 05:32 PM
Re: Auto Start script question
For products that don't you may wish to start with a copy of template in /sbin/init.d
Its a good starting point.
Please upload the script.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 07:27 AM
12-21-2003 07:27 AM
Re: Auto Start script question
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 10:37 AM
12-21-2003 10:37 AM
Re: Auto Start script question
you might want to reroute the output of the start script of tivoli to some place else.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 02:33 PM
12-21-2003 02:33 PM
Re: Auto Start script question
PATH=/sbin:/usr/sbin:/usr/bin:/opt/tivoli/tsm/client/ba/bin
export PATH
rval=0
set_return() { x=$?
if [ $x -ne 0 ]; then
echo "ERROR CODE $x"
rval=1
fi
}
case $1 in
start_msg)
echo "Start Tivoli server daemon"
;;
stop_msg)
echo "Stopping Tivoli server daemon"
;;
'start')
if [ -f /opt/tivoli/tsm/client/ba/bin/dsmc ] ; then
cd /tiv nohup /opt/tivoli/tsm/client/ba/bin/dsmc schedule &
else
echo "ERROR: /opt/tivoli/tsm/client/ba/bin/dsmc file MISSING"
fi
rval=2
;;
'stop') #
# Determine PID of process(es) to stop
#
pid=`ps -ef|grep dsmc|grep -v grep |awk '{print $2}'`
if [ "X$pid" != "X" ]; then
if kill $pid; then
echo "Tivoli daemon stopped"
else
set_return
echo "Unable to stop Tivoli daemon
fi
fi
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
exit $rval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2003 12:43 AM
12-22-2003 12:43 AM
Re: Auto Start script question
What happens if you run the script
/sbin/init.d/script start
This is the networker file that legato installed
#!/sbin/sh
# installed by postinstall on Wed Nov 19 16:59:06 EST 2003
#
# Default locale
#
LANG=C
export LANG
# Override to a different locale if /usr/lib/nsr/LANG exist
[ -r /usr/lib/nsr/LANG ] && . /usr/lib/nsr/LANG
case $1 in
'start_msg')
echo 'Starting Networker daemons'
;;
'stop_msg')
echo 'Stopping Networker daemons'
;;
'start')
(echo 'starting NetWorker daemons:') >> /etc/rc.log
if [ -f /opt/networker/bin/nsrexecd ]; then
(/opt/networker/bin/nsrexecd) >> /etc/rc.log 2>&1
(echo ' nsrexecd') >> /etc/rc.log
fi
if [ -f /opt/networker/bin/lgtolmd ]; then
(/opt/networker/bin/lgtolmd -p /nsr/lic -n 1) >> /etc/rc.log 2>&1
(echo ' lgtolmd') >> /etc/rc.log
fi
if [ -f /opt/networker/bin/nsrd -a ! -f /opt/networker/bin/NetWorker.clustersvr
]; then
(/opt/networker/bin/nsrd) >> /etc/rc.log 2>&1
(echo ' nsrd') >> /etc/rc.log
fi
;;
'stop')
(echo 'stopping NetWorker daemons:') >> /etc/rc.log
if [ -f /opt/networker/bin/nsr_shutdown ]; then
if [ -f /opt/networker/bin/NetWorker.clustersvr ]; then
(/opt/networker/bin/nsr_shutdown -c -a -q&) >> /etc/rc.log 2>&1
(echo ' nsr_shutdown -c -a -q') >> /etc/rc.log
else
(/opt/networker/bin/nsr_shutdown -a -q&) >> /etc/rc.log 2>&1
(echo ' nsr_shutdown -a -q') >> /etc/rc.log
fi
fi
;;
*)
echo "usage: `basename $0` {start|stop}"
;;
esac
I only get the start and stop messages. Networker sends its annoying crap to the console.
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2003 01:28 AM
12-22-2003 01:28 AM
SolutionThe logging code is being produced by the command:
/opt/tivoli/tsm/client/ba/bin/dsmc schedule
If you run this from a shell prompt and it does not produce a log listing, then the environment is triggering the log dump. You'll need to explicitly create the same environment during start-up since start-up doe NOT login and run any profiles. To see how different the login environment is from the start-up environment, save the output of the env command from a login prompt and add env to your start script. Just add the missing items to your start script.
As far as starting and stopping, here are a couple of suggestions:
1. Rather than check the executable as a file (-f option), use the -x instead. This verifies that the executable exists and is also executable.
2. Searching for a process using grep can produce very ambiguous results since grep does not look at the process name--it looks at everything on the line including user names and command line arguments. Elimnate the ambiguiy by letting ps search for you (it's much faster). Change the lines:
pid=`ps -ef|grep dsmc|grep -v grep |awk '{print $2}'`
if [ "X$pid" != "X" ]; then
if kill $pid; then
echo "Tivoli daemon stopped"
else
set_return
echo "Unable to stop Tivoli daemon
to:
PID=$(UNIX95= ps -C dsmc -o pid | tail -1)
if [ $PID = PID ]
then
echo "Tivoli dsmc not running"
else
if kill $PID
then
echo "Tivoli daemon stopped"
fi
fi
The construct "UNIX=95 ps" activates a large number of additional parameters for ps including -C -H and -o. -o is particularly useful as you can specify exactly what you want from ps. If the process is not found, just the text "PID" is returned, otherwise, the PID for the last occurance of dsmc will be returned. In the above code, you can test it using everything inside the parens $() (which is strongly preferred over backtics or grave accent (see man page for sh-posix or ksh). For instance, these two constructs produce very different results:
ps -ef | grep sh | grep -v grep
UNIX95= ps -fC sh
The second form is accurate because ps looks at the process table by name, not by grep'ing a bunch of unrelated fields.
Bill Hassell, sysadmin