Operating System - HP-UX
1752815 Members
5668 Online
108789 Solutions
New Discussion юеВ

Re: i want to add stop and strtup script in system startup and shutdown procedure ,

 
SOLVED
Go to solution
arun khatwani
Frequent Advisor

i want to add stop and strtup script in system startup and shutdown procedure ,

тАв Shutdown
o Execute the script : /appl/control_m/agent/scripts/control_s7p.sh stop
o Script must be execute by uid : root
тАв Startup
o Execute the script : /appl/control_m/agent/scripts/control_s7p.sh start
o Script must be execute by uid : root


Where can i add these scripts so that it automatically stop when system going down and start when sytaem coming up.

in /sbin/rc.d

tell me the complete commands.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: i want to add stop and strtup script in system startup and shutdown procedure ,

HI Arun:

Hi:

You need to acquaint yourself with the 'rc' (run control) scripts.

I _urge_ you to take the time to begin by reading:

http://docs.hp.com/en/934/startup.pdf

This whitepaper is _still_ valid and is summarized in the 'rc(1M)' manpages too:

http://docs.hp.com/en/B2355-60130/rc.1M.html

Be sure to copy and use '/sbin/init.d/template' as the model for your start/stop needs.

Regards!

...JRF...
arun khatwani
Frequent Advisor

Re: i want to add stop and strtup script in system startup and shutdown procedure ,

Yes ,
but can you tell me now how can we add these scripts,

i have to add it to /sbin/init.d adn have linked to /sbin/rc''

can you tell me the procedure or the commands.
James R. Ferguson
Acclaimed Contributor

Re: i want to add stop and strtup script in system startup and shutdown procedure ,

Hi (again):

> but can you tell me now how can we add these scripts, i have to add it to /sbin/init.d adn have linked to /sbin/rc''

Do you mean how you create the symbolic links? Then, something like:

# ln -s /sbin/init.d/s7p /sbin/rc3.d/S900s7p
# ln -s /sbin/init.d/s7p /sbin/rc2.d/K100s7p

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: i want to add stop and strtup script in system startup and shutdown procedure ,

> can you tell me now how can we add these scripts

You really need to read the startup document mentioned above. The directory /sbin/init.d is a collection of all start/stop scripts. To get them to run in the right order, you create symbolic links in the special rc directories. But you can also leave the start/stop script in the control_m directory. The symbolic links are run in alphabetical order and must start with "S" typically followed by a 3 digit number and then the name of your start script. The purpose of the S123 prefix is to set the order of startup. The same is true with "K" symbolic links for proper shutdown.


Bill Hassell, sysadmin