- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how auto run my program when the hp_ux11.0 was...
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
05-26-2002 10:33 PM
05-26-2002 10:33 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2002 10:36 PM
05-26-2002 10:36 PM
SolutionYou make a script that starts up your program.
this goes into /sbin/init.d/
I usually take a copy of the "lp" script in this directory, rename it, and use that as an example.
Next you place a file in /etc/rc.config.d the same name as your startup script.
This file has one thing in it VARIABLE=1
the name variable is usualloy also the same as your startup script name.
Then you link it to a run level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2002 10:43 PM
05-26-2002 10:43 PM
Re: how auto run my program when the hp_ux11.0 was booted?
You need to set a script into a run-level
on your server and have it linked to a
executable script that starts your application.
e.g.
/sbin/init.d/dbstart
has a link from /sbin/rc3.d/S880dbstart
The script should executable. You should also
have a termination script in /sbin/init.d/rc2.d
depending on your application. Mine is /sbin/rc2/K100dbstop, which links to the same script, for termination of the database.
You also should use a config file say in /etc/rc.config.d/dbstart so that the application start/stop can be changed. Use one of the examples from your system. You will see that this part is easy
#!/sbin/sh
#
# @(#) $Revision: 72.11 $
#
# NOTE: This script is not configurable! Any changes made to this
# script 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.
#
# This will START/STOP Informix Instances at Start-up / Shutdown
#
# Allowed exit values:
# 0 = success; causes "OK" to show up in checklist.
# 1 = failure; causes "FAIL" to show up in checklist.
# 2 = skip; causes "N/A" to show up in the checklist.
# Use this value if execution of this script is overridden
# by the use of a control variable, or if this script is not
# appropriate to execute for some other reason.
# 3 = reboot; causes the system to be rebooted after execution.
# Input and output:
# stdin is redirected from /dev/null
#
# stdout and stderr are redirected to the /etc/rc.log file
# during checklist mode, or to the console in raw mode.
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
# NOTE: If your script executes in run state 0 or state 1, then /usr might
# not be available. Do not attempt to access commands or files in
# /usr unless your script executes in run state 2 or greater. Other
# file systems typically not mounted until run state 2 include /var
# and /opt.
rval=0
# Check the exit value of a command run by this script. If non-zero, the
# exit code is echoed to the log file and the return value of this script
# is set to indicate failure.
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 # script FAILed
fi
}
case $1 in
'start_msg')
echo "Starting the
;;
'stop_msg')
echo "Stopping the
;;
'start')
# source the system configuration variables
if [ -f /etc/rc.config.d/dbstrstp ] ; then
. /etc/rc.config.d/dbstrstp
else
echo "ERROR: /etc/rc.config.d/dbstrstp defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$DBINST" -eq 1 ]; then
/usr/local/bin/dbstart -all
else
rval=2
fi
;;
'stop')
# source the system configuration variables
if [ -f /etc/rc.config.d/dbstrstp ] ; then
. /etc/rc.config.d/dbstrstp
else
echo "ERROR: /etc/rc.config.d/dbstrstp defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$DBINST" -eq 1 ]; then
/usr/local/bin/dbstop -all
else
rval=2
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval
HTH
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2002 11:23 PM
05-26-2002 11:23 PM
Re: how auto run my program when the hp_ux11.0 was booted?
Because my typing is very ordinary it is recommended to have your numbers so that they add up to 1000. Usually the high numbers are used to start, i.e. 880 and the low numbers for termination, i.e. 120
So, an example /sbin/rc3.d/S880dbstart pairs off with /sbin/rc2.d/K120dbstop. You can use the variable number as Scott has suggested as a good guide for your config file, /etc/rc.config.d/dbstart
Cheers
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2002 12:03 AM
05-27-2002 12:03 AM
Re: how auto run my program when the hp_ux11.0 was booted?
What micheal says is the right procedure. If you plan only to start and not to stop you can do this.
1.)go to /sbin/rc3.d
2.)select the Sxxx file which is having a highest numeric value(xxx)
3.) edit that file and add in your commends & comments at the last line.
This will ensure the program is run always whenever the system is restarted.
Regards,
Gnana A.