- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to make sartup 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
05-22-2006 02:58 AM
05-22-2006 02:58 AM
i would like add some file at start up what are the steps like this is this file /opt/sw/mygame
now mi need whenever start the server it should it automatically
please give the procedure with example
thanks
siva
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2006 03:01 AM
05-22-2006 03:01 AM
Re: how to make sartup script
Start up when login,
then use
.profile in $HOME
exec /opt/sw/mwgame
This will directly start when as you login.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2006 03:04 AM
05-22-2006 03:04 AM
Re: how to make sartup script
I'm not sure how you choose the number that comes after the S and the K, but someone who does is bound to be along shortly!
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2006 03:05 AM
05-22-2006 03:05 AM
SolutionEdit the file and add the commands to start the script under section 'start') in the case switch options in the mygame file where its written
# Execute the commands to start your subsystem
Similarly write the commands to stop the script under stop section after the line
# Execute the commands to stop your subsystem
Now goto /sbin/rc3.d and create a link to the file
ln -s /sbin/init.d/mygame S900mygame
goto /sbin/rc0.d and create a link
ln -s /sbin/init.d/mygame K900mygame.
And you are ready to roll.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2006 03:28 AM
05-22-2006 03:28 AM
Re: how to make sartup script
For a complete understanding of how to properly setup startup (and shutdown) processes (which is quite easy), read this short white paper
http://docs.hp.com/en/934/startup.pdf
Disregard the fact that the paper is written for HP-UX 10.x -- it applies to all version onward.
As noted, there is a template file that you should modify to setup your own startup/shutdown script: '/sbin/init.d/template'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2006 03:37 AM
05-22-2006 03:37 AM
Re: how to make sartup script
1) Using the "tempplate" file in /sbin/init.d/ as a guide, copy this file to a new file, e.g. /sbin/init.d/myscript and modify to fit your needs. The code that should be executed at startup goes in the start) section of the case statement. Similarly, the code that shold be executed at shutdown goes in the stop) section. There are also start_msg) and stop_msg sections that can be used to echo messages.
2) Determine the run-level that you wish to start the script. The start scripts run in lexical order so for example if you wanted your script to start rather late at run-level 3 then you would create a symbolic link like this:
ln -s /sbin/init.d/myscript /sbin/rc3.d/S950myscript/
3) If the script starts in run-level N then it should be stopped at run-level N-1. You should use a 3-digit decimal number so that
the "start" and "stop" numbers add to 1000. In our example, if your start script is "950" then your stop script should be "050". This convention generally orders the start and stop sequence correctly.
ln -s /sbin/init.d/myscript /sbin/init.d/K050myscript