Operating System - HP-UX
1835626 Members
3036 Online
110080 Solutions
New Discussion

Re: Starting a service at boot time

 
Francisco Mancardi_1
Frequent Advisor

Starting a service at boot time

I have experience in the Solaris way to start a service at boot time
(the rc?.d dirs and the Sxxscripts) and I need to do the same in
a HPUX platform.
I would like a document where to read about it.
Any hint ?

Thanks

Francisco
4 REPLIES 4
linuxfan
Honored Contributor

Re: Starting a service at boot time

Hi Francisco,

The startup scripts are normally in /sbin/init.d directory, with the configuration files in /etc/rc.config.d

The links are normally created in /sbin/rc?.d directory for different run levels.
Here ? is the runlevel 0, 1,2,3,4 etc

Also in the /usr/share/doc directory there is a document called start_up.txt which describes the whole startup procedure.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sridhar Bhaskarla
Honored Contributor

Re: Starting a service at boot time

You will get a very good idea if you can go through /etc/rc.config.d and /sbin/init.d and
/sbin/rc*.d directory.

The startup and shutdown scripts are in /sbin/init.d

/sbin/rcx.d determines what run level we want these scripts to run.

/etc/rc.config.d/config_file set the environment for the files in /sbin/init.d
mostly flag files

The following URL gives a good explanation

http://www.docs.hp.com/hpux/onlinedocs/os/startup.pdf

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Darrell Allen
Honored Contributor

Re: Starting a service at boot time

Check out the white paper on Startup and Configuration found at http://docs.hp.com/hpux/os/10.x/index.html
Even though it's for 10.x it will be quite helpful.

Another tip: Use the ITRC search page. I found a number of hits just by searching for "boot script".

Darrell

"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
linuxfan
Honored Contributor

Re: Starting a service at boot time

Hi,

The file /sbin/init.d/template is a good starting place for making your own start/stop scripts.

Each script under /sbin/init.d normally performs both the startup and shutdown functions. And once you write your script and test it out you create two links one for startup and one for shutdown.

for eg: you create a script called "myscript" (make it an executable and set the right permissions and test it)
you want this to come up in run level 3

ln -s /sbin/init.d/myscript /sbin/rc3.d/S992myscript
ln -s /sbin/init.d/myscript /sbin/rc1.d/K992myscript

This ensures that your scripts does a start in run level 3 and a stop in run level 1

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates