- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Informix Startup Script
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
06-17-2004 04:31 PM
06-17-2004 04:31 PM
Is anybody having script that I can put on my
HP-UX server so that every time when i reboot
my INFORMIX server should get automatically
started and during shutdown it should down
the informix server properly.
Thanks
Amit
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 07:20 PM
06-17-2004 07:20 PM
Re: Informix Startup Script
Objective: Add script which starts scoupx subsystem when the system transitions up to run-level 3 and stops the scopux subsystem whenever the transitions down to run-level 2.
1. cd /sbin/init.d --> cp template scope_collect --> vi scope_collect
2. Edit start_msg and stop_msg statement.
3. Edit start statement: Change CONTROL_VARIABLE to SCOPE_COLLECT --> add command /opt/perf/bin/scope.start --> add command set_return.
4. Edit stop statement: Change CONTROL_VARIABLE to SCOPE_COLLECT --> add command /opt/perf/bin/scope.stop --> add command set_return.
5. vi /etc/rc.config.d/scopt_collect --> add single line, SCOPE_COLLECT=1.
6. ln -s /sbin/init.d/scope_collect /sbin/rc3.d/S900scope_collect
7. ln -s /sbin/init.d/scope_collect /sbin/rc2.d/K100scope_collect
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 10:06 PM
06-17-2004 10:06 PM
SolutionHere's what we use (/sbin/init.d/informix):
#!/sbin/sh
#
# @(#) $Revision: 72.5 $
#
# NOTE: This script is not configurable! Any changes made to this
# scipt will be overwritten when you upgrade to the next
# release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
# is unbootable. Do not modify this script.
#
#
# Informix start up
#
PATH=/sbin:/usr/sbin:/usr/bin:$INFORMIXDIR:$INFORMIXDIR/bin
export PATH
rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1
fi
}
case $1 in
start_msg)
echo "Start Informix daemon"
;;
stop_msg)
echo "Stop Informix daemon"
;;
'start')
if [ -f /etc/rc.config.d/informix ] ; then
. /etc/rc.config.d/informix
else
echo "ERROR: /etc/rc.config.d/informix defaults file MISSING"
fi
if [ "$INFORMIX" -eq 1 -a -x /opt/informix/bin/oninit ]; then
/opt/informix/bin/oninit && echo informix started
set_return
else
rval=2
fi
;;
'stop')
#
# Determine PID of process(es) to stop
#
if [ -x /opt/informix/bin/onmode ]; then
/opt/informix/bin/onmode -kyu && echo informix stopped
fi
;;
*)
echo "usage: $0 {start|stop}"
rval=1
;;
esac
The spacing will get truncated so I'll attach it as well. Along with that, you need to set any variables in /etc/rc.config.d/informix:
#!/sbin/sh
# @(#) $Revision: 72.3 $
#
# INFORMIX: Set to 1 to start Informix daemon.
#
INFORMIX=1
# KAIOON=1 6/30/97 experiment
export INFORMIXDIR=/opt/informix
export INFORMIXSERVER=m_tcp_1
export ONCONFIG=onconfig.DATABASE
#
# Look in "/sbin/init.d/informix" for INFORMIXSERVER change for "onprobe"
#
Finally, you need to establish the startup and shutdown links as follows:
lrwxrwxr-x 1 root sys 18 Oct 18 2002 /sbin/rc2.d/K100informix -> ../init.d/informix
lrwxrwxr-x 1 root sys 18 Oct 18 2002 /sbin/rc3.d/S998informix -> ../init.d/informix
That's all there is to it!
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 10:15 PM
06-17-2004 10:15 PM
Re: Informix Startup Script
I have written a script to startup and
shutdown the server, but dont know where
to put this script and by which name
Thanks,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 10:46 PM - last edited on 09-16-2024 02:26 AM by support_s
06-17-2004 10:46 PM - last edited on 09-16-2024 02:26 AM by support_s
Re: Informix Startup Script
The script goes in /sbin/init.d and can be called anything you like. The key is the links that I showed you earlier. As rc progresses up through the run levels on startup, all the scripts in the rc directory for that run level get parsed with an argument of "start". In this case, we want to startup Informix after everything else is up so we put the startup link in rc3.d as S998informix. Once again, you could call it anything you like but the sequence number governs the order in which it gets parsed. The same idea holds true on shutdown. We want Informix shut down first so we put the link in rc2.d with a low sequence number.
That's it!
Pete
Pete
- Tags:
- power supply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 11:15 PM
06-17-2004 11:15 PM
Re: Informix Startup Script
looking at your script, it mentions $INFORMIXDIR in the PATH at the top before you have sourced the informix script in rc.config.d.
Fortunately you put the full path in when you start and stop the database, so it works anyway.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 11:21 PM
06-17-2004 11:21 PM
Re: Informix Startup Script
I should also mention to Amit that not only the sequence number of the link is important - they have to begin with K for the shutdown and S for the startup. When rc switches run levels on the way up, it parses all the S* scripts in order and on the way down it parses all the K* scripts in order. I forgot to point that out.
Pete
Pete