- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Scripts to be automated after, Server Reboots
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
01-22-2002 10:07 PM
01-22-2002 10:07 PM
I want to start some services, like application server, thru a shell script, immediately I reboot the server (hp unix 11).
Where should I specify the script name to be run immediately server comes up?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 10:21 PM
01-22-2002 10:21 PM
Re: Scripts to be automated after, Server Reboots
Hi,
Automatic startup scripts are placed into
the /sbin/init.d directory. Also a symbolic
link is created in the /sbin/rc2.d or /sbin/rc3.d
directory pointing to the script.
For example if you had an application called x
you would have a startup script in /sbin/init.d/x
with a symbolicc link pointing to it from
/sbin/rc3.d/S501x and another script in
/sbin/rc2.d/K499x to stop it.
It is good practise to use these numbers that
add up to 1000. You will see that this occurs
for other applications that start and stop
on your server.
HTH
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 10:24 PM
01-22-2002 10:24 PM
Re: Scripts to be automated after, Server Reboots
Check directory /sbin.
There you have some subdirectories named rc0.d and so on. the rcand the number represent the runlevel, where different services will be started. The original start script should be placed in /sbin/init.d Then you should place a softlink ( ln -s originalfile linkname )to your original startscript in rc3.d, because then your machine is in runlevel 3 and all necessary services have been started.
Rgds
Alexander M. Ermes
;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 10:30 PM
01-22-2002 10:30 PM
Re: Scripts to be automated after, Server Reboots
then make link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 10:31 PM
01-22-2002 10:31 PM
Re: Scripts to be automated after, Server Reboots
For a full understanding, here is link to a document that will explain it fully.
http://docs.hp.com/hpux/onlinedocs/os/startup.pdf
HTH
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 10:48 PM
01-22-2002 10:48 PM
Re: Scripts to be automated after, Server Reboots
Thanks lot, I just need some further clarifications, I am not a unix guy.
As I have to restart the datbase and other application services, imme after server starts up. I have a script called STARTALL.sh
so i have placed it in /sbin/init.d dir.
after this how should I create a link from /sbin/rc2.d dir?
is this is the only thing I have to do?
And one more thing, I saw there are many files in /sbin/init.d dir, does unix run all these files while starting up unix server?
Thanks & Regards
Syed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 05:22 AM
01-23-2002 05:22 AM
SolutionAs already suggested, 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...