- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: start application when the machine start
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-06-2002 05:21 AM
05-06-2002 05:21 AM
start application when the machine start
How can I do
Thinks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:22 AM
05-06-2002 05:22 AM
Re: start application when the machine start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:27 AM
05-06-2002 05:27 AM
Re: start application when the machine start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:30 AM
05-06-2002 05:30 AM
Re: start application when the machine start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:30 AM
05-06-2002 05:30 AM
Re: start application when the machine start
If you haven't, read either version of the document below. I???ll summarize the key points here.
/usr/share/doc/start_up.txt
http://docs.hp.com/hpux/onlinedocs/os/startup.html
The file /sbin/init.d/template is a good starting place for making your own start/stop scripts.
The /sbin/init.d directory contains all scripts used to startup and shutdown various subsystems.
Each script under /sbin/init.d should perform BOTH the startup and shutdown functions. In order to control the functionality within the script, each must also support standard arguments and exit codes. Scripts must be written for the POSIX shell. A template script may be found in /sbin/init.d/template.
There is no reason why the startup and shutdown script cannot start/kill multiple, but related processes. Remember to choose the appropriate rc
Each script in /sbin/init.d performs BOTH the startup and shutdown functions, and each will have two links pointing towards the script from /sbin/rc*.d: one for the start action and one for the stop action.
Start scripts begin with "S"; Kill (stop) scripts begin with "K". The order of execution for kill scripts is the reverse of the startup ones.
if a start script is placed in directory '/sbin/rc{X}.d' then its corresponding kill script is put in directory '/sbin/rc{X-1}.d'
A general rule-of-thumb is that the sequence number of the start script plus the sequence number of the kill script should add to 1000.
Subsystems should be killed in the opposite order they were started. This implies that kill scripts will generally not have the same numbers as their start script counterparts. If two subsystems must be started in a given order due to dependencies (e.g., S200sys1 followed by S300uses_sys1), the counterparts to these scripts must be numbered so that the subsystems are stopped in the opposite order in which they were started (e.g., K700uses_sys1 followed by K800sys1). The '1000' rule leads to this behavior.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:31 AM
05-06-2002 05:31 AM
Re: start application when the machine start
file /sbin/init.d/template is a good starting place for making your own start/stop scripts.
Each script under /sbin/init.d does both the startup and shutdow. And once you write your script and test it out you create two links one for startup and one for shutdown.
for eg: you create a script called "xyz" make it an executable and set the right permissions and test it
you want this to come up in run level 3. create a link
ln -s /sbin/init.d/xyz /sbin/rc3.d/S992xyz
ln -s /sbin/init.d/xyz /sbin/rc2.d/K992xyz
This ensures that your scripts does a start in run level 3 and a stop in run level 2
How to test it.
Run
#/sbin/rc3.d/S992xyz start
If it don't work and if you want to debug then add
set -x
on top of /sbin/init.d/xyz script.
Run it again and it will run it in debug mode.
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:35 AM
05-06-2002 05:35 AM
Re: start application when the machine start
Quick & Dirty -
Put your start | stop script for your application in /sbin/init.d/ - check the scripts there for examples if you don't have a script.
Create links in /sbin/rc#.d/ as so...
ln -s /sbin/init.d/appscript /sbin/rc2.d/K123app
ln -s /sbin/init.d/appscript /sbin/rc3.d/S877app
This will run the script with the "stop" (K) parameter when the box goes down to run-level 2, and with the "start" (S) parameter when it enters run-level 3.
The K### and S### numbers are usually set to add up to 1000 - That's convention, not required.
Any configuration files tend to go in /etc/rc.config.d/
At any rate, a search of the forums will give you a TON of info.
HTH
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 05:49 AM
05-06-2002 05:49 AM
Re: start application when the machine start
Copy your startup shell script to the /sbin/init.d directory. Then create links to the /sbin/rc3.d directory beginning with the letter 'K' and a serial number alongwith your script name and a 'S' with a serial number alongwith your script name.
Please read man rc as the sequence of startup and shutdown matters.
Thats all.
-Sukant