1829035 Members
2541 Online
109986 Solutions
New Discussion

startup

 

startup

I want to put my software in startup .how do i do it. in other words i want to start my software licence server when i boot my hp -ux server.
6 REPLIES 6
Geoff Wild
Honored Contributor

Re: startup

Create script in /sbin/init.d

Create symbolic links to these scripts as follows:
Place startup script links in the /sbin/rcN.d directory, (where N is the run level in which you want the subsystem to be started), and place shutdown script links in the /sbin/rcN-1.d directory (so that the subsystem will be shut down when entering run level N-1 from a higher run level).
The naming convention for startup and shutdown links is as follows:
startup: S<script_name>
shutdown: K<script_name>
where S stands for "start" and K stands for "kill", seqn is the sequence number, and script_name is the name of the script in /sbin/init.d. Sequence numbers for startup and shutdown are typically not the same.

Look a a script in /sbin/init.d as an example..

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.
Bharat Katkar
Honored Contributor

Re: startup

HI mangesh,
Let us assume you have scirpt in /opt/mangesh/myscirpt and you want your script to start at run level 2 (multiuser) and stop at run level 0.
# cp /opt/mangesh/myscript /sbin/init.d
# cd /sbin/rc2.d
# ln -s /sbin/init.d/myscript Smyscriptlink
# cd /sbin/rc0.d
# ln -s /sbin/init.d/myscript Kmyscriptlink

That all.
Remeber sequence number you can decide on your own but should be unique. It will decide the execution priority. For example S100... will be executed first and S101... afterwards.

Hope this helps.
Regards,
You need to know a lot to actually know how little you know
Victor Fridyev
Honored Contributor

Re: startup

Hi,

In addition to the previous correct recommendations please find an example of a start/stop script according to HPUX standards. Please put your attention on a configuration file located in /etc/rc.config.d/netconf. You can cancel start up of the application changing flag in the file.

HTH
Entities are not to be multiplied beyond necessity - RTFM

Re: startup

i also want to stop the software when i shutdown the server.please help


thanks for ur quick response
Michael Tully
Honored Contributor

Re: startup

There is a template file in /sbin/init.d that can be used as a guide.
Anyone for a Mutiny ?
Bharat Katkar
Honored Contributor

Re: startup

Mangesh,
That is also explained in the previous response given by geoff and me.
You only have to create link to the script in rc0.d which start's with K (it stands for kill) and argument stop is passed to your script.
Similarly for startup another link is placed in rc2.d which starts with S ( it stands for start ) and aurgument start is passed to your sript.

That's all.
Regards,

You need to know a lot to actually know how little you know