- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Custom Start/Kill 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
10-23-2001 04:47 PM
10-23-2001 04:47 PM
Custom Start/Kill Script
I would like to start a 3rd party application at rc3. I've custom a S/K script for the application. However, I'm doubtful of whether I could simply put any unique sequence number for the script or there is any rules for this?
Thanks in advanced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 04:58 PM
10-23-2001 04:58 PM
Re: Custom Start/Kill Script
THe answer is yes you can. If anything in your start script depends upon some other service begin started first at run-level 3 then simply make sure that your S filename comes later in lexical order. It is perfectly acceptable to have S209mycode and S209yourcode. S209mycode is first in lexical order so that it runs before S209yourcode. The standard convention is that the 'S' value + the 'K' value = 1000. That is not a requirement but it does tend to correctly order the start/stop. In this example you should have /sbin/rc3.d/S209yourcode and /sbin/rc2.d/K791yourcode. Of course, both of these should be symbolically linked to /sbin/init.d/yourcode.
The other convention is that there should be a file /etc/rc.config.d/yourcode which contains any variables and usually a 1 or 0 value to indicate whether the script should run at all.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 05:00 PM
10-23-2001 05:00 PM
Re: Custom Start/Kill Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 07:08 PM
10-23-2001 07:08 PM
Re: Custom Start/Kill Script
Start - S900
Kill - K100
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 10:34 PM
10-23-2001 10:34 PM
Re: Custom Start/Kill Script
You can assign numbers and a name as you wish but make sure that if you need something to be started before your application, put your application lexically 'after' the 'something'. Also, if another service needs your app, make sure your app starts before it.
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 10:51 PM
10-23-2001 10:51 PM
Re: Custom Start/Kill Script
You can assign any numbers that you wish to
use, however in saying that you may have
some dependancy with your application in
that perhaps your databases need to be
started first, in which case use a higher
number that your database to start and
a lower one to stop. You could start with
say S991startapp in rc3.d and K009stop in
rc2.d. The numbers when used should
generally add up to 1000.
HTH
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 11:22 PM
10-23-2001 11:22 PM
Re: Custom Start/Kill Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2001 11:23 PM
10-23-2001 11:23 PM
Re: Custom Start/Kill Script
Be sure to keep enough gaps, or sooner or later, you need to rename everything to insert something additional :-)
Beside this there are no rules, just the mentioned recommendations.
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 01:24 AM
10-24-2001 01:24 AM
Re: Custom Start/Kill Script
That said, typically the startup/kill scripts are both one script located in /sbin/init.d with symbolic links to the approprate run levels for startup and kill, i.e. if I have a script called oracle, then the setup would be something like this:
/sbin/init.d/oracle
/sbin/rc2.d/K999oracle ->/sbin/init.d/oracle
/sbin/rc3.d/S999oracle -> /sbin/init.d/oracle
Also, the script should have startmsg and stopmsg funtions. These are the messages that it display on the console screen when starting/killing the processes. Take a look at /sbin/init.d/template for more details.
Hope this helps.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 02:03 AM
10-24-2001 02:03 AM
Re: Custom Start/Kill Script
I'd like to reinforce one key point about startup/shutdown order and the '1000' guideline.
First, if a start script is place 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.
Also, choose the appropriate rc
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.
If you can't find the document file that Melvyn suggested you read, it is present here:
http://docs.hp.com/hpux/onlinedocs/os/startup.html
The document is a easy reading and will answer all of your questions.
Regards!
...JRF...