Operating System - HP-UX
1834326 Members
3313 Online
110066 Solutions
New Discussion

How to set a script be ran auto when the system reboot

 
SOLVED
Go to solution
Gary L
Super Advisor

How to set a script be ran auto when the system reboot

Hi

I wanna set a script be ran automaticly when the system reboot (HP-UX). How to do it. save to .sh to /etc/rc.config.d/ ?

thanks a lot?

-Gary
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to set a script be ran auto when the system reboot

Hi Gary:

The manpages for 'rc(1M)' tell you how to do this and how the startup/shutdown paragigm works. ALternately, you can read:

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

...which, while release for HP-UX 10.x is valid for current releases, too.

Use the '/sbin/init.d/template' script as your template.

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: How to set a script be ran auto when the system reboot

Do a man on rc.


Pete

Pete
Gary L
Super Advisor

Re: How to set a script be ran auto when the system reboot

Hi James

Thank you very much for your fast reply. I will check the doc that your provided soon.
BTW, whether I could save the .sh script to /sbin/init.d or /erc/rc.config.d

-Gary
Gary L
Super Advisor

Re: How to set a script be ran auto when the system reboot

thanks peter
Gary L
Super Advisor

Re: How to set a script be ran auto when the system reboot

sorry,
thanks pete randall
James R. Ferguson
Acclaimed Contributor

Re: How to set a script be ran auto when the system reboot

Hi (again) Gary:

> BTW, whether I could save the .sh script to /sbin/init.d or /etc/rc.config.d

Get a *COPY* of the template file. It is saved in '/sbin/init.d'. The file that contains configuration variables will be saved in '/etc/rc.config.d'. Appropriate symbolic links will be made in /sbin/rc?.d' and will point to the '/sbin/init.d/' script. Thus, in all, you will genenerally have *four* files --- a configuration file; the start/stop script; a startup link; and a shutdown link file.

The documentation explains this in detail. Be sure to observe the "rule-of-1000".

Regards!

...JRF...
Gary L
Super Advisor

Re: How to set a script be ran auto when the system reboot

Thanks James

Every details

have a great day