Operating System - HP-UX
1833262 Members
2749 Online
110051 Solutions
New Discussion

run process when boot system

 
juno3
Occasional Advisor

run process when boot system

I would like to run some processes everytime when booting the system eg. start db/services , what files should be modify ? thx
5 REPLIES 5
Geoff Wild
Honored Contributor

Re: run process when boot system

put your processes in a script in /sbin/init.d

create an /etc/rc.config.d/ file

Create a Start link to your script in /sbin/init.d from /sbin/rc2.d and a Stop link in /sbin/rc1.d


Lokk at the files in those directories for examples...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Stuart Abramson_2
Honored Contributor

Re: run process when boot system

The 3 key files are:

/etc/rc.config.d/program_name
/sbin/init.d/program_name
/sbin/rc4.d/S100program_name

Attached is an example of how we did this for an applcation called "mqseries".

Stuart
Jeff Schussele
Honored Contributor

Re: run process when boot system

Hi,

Preferred way to do this is to create a stop/start script, place it in /sbin/init.d. You then place links into /sbin/rc3.d for the startup & /sbin/rc2.d for the shutdown. You also want an config file in /etc/rc.config.d to be able to toggle the auto start/stop on & off.
See any file in /sbin/init.d for example os how that script should look & function. Also note how the files in /sbin/rcX.d should be linked th the /sbin/init.d files & also how they should be named & how that naming affects startup order. See any of the config files in /etc/rc.config.d for examples of how that conf file should look.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
kuksaa_1
New Member

Re: run process when boot system

You can create your own script
and lunch it during boot:

f.e.

1)cp /sbin/init.d/template /sbin/init.d/your_script

2)then vi, change parameters needed to launch your service

3) create /etc/rc.config.d/your_script

and add variable you defined
YOUR_SCRIPT_SERVICE=1

4) make simlinks to the appropriate runlevels to start and stop appropriate service

Thanks...