HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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