1833459 Members
2950 Online
110052 Solutions
New Discussion

Re: shutdown

 
SOLVED
Go to solution

shutdown

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


i thank u all for ur quick response
5 REPLIES 5
Amit Manna_6
Regular Advisor
Solution

Re: shutdown

Hi,

Which software you want to stop??

Michael Tully
Honored Contributor

Re: shutdown

Using the script template in /sbin/init.d/template there is a case statement that applies to both start/stop from within the script. Using symbolic links as descibed in your other post will take care of both start and stop.
Anyone for a Mutiny ?
Bharat Katkar
Honored Contributor

Re: shutdown

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=605159
You need to know a lot to actually know how little you know
Anupam Anshu_1
Valued Contributor

Re: shutdown

Write a wrapper (script) to shutdown the server. When you want to shutdown the server, execute this wrapper. You can have your script as follows (depending upon which program should stop first):

----------------------

server stop
software stop

or

software stop
server stop

-----------------------

Else, if you can modify the "server stop" program, then a modify the "server stop" program and add the "software stop" line to it.

HTH,

Anshu
Anil C. Sedha
Trusted Contributor

Re: shutdown

Copy any script under /sbin/init.d/ to a script name /sbin/init.d/yourscript.

Then edit the file, and change the stop & start commands part of it with the commands that you use for start/stop.

Secondly, create a file under /etc/rc.config.d/yourscript and then edit the file and enter a paramter that when set to "1" will run the /sbin/init.d/yourscript at shutdown/startup, else if "0" will ignore it. Check for other /etc/rc.config.d files to see as an example.


Then create a link under /etc/rc2.d/K900yourscript (required for application to shut down automatically when system shuts down).

and
under /etc/rc3.d/S900yourscript (required for application to startup automatically when system starts up).

Regards,
Anil
If you need to learn, now is the best opportunity