• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

need a RC script

I'm running one java apps on Redhat 8.0. I would like a daemon cript to start and stop for my apps(just like /etc/rc.d.init.d/sendmail -- ).

I'm running java program thru one shell script(i.e startup.sh) content of startup.sh

java -cp :core.jar:Opta2000.jar:uinmsg.jar:some.jar Server -log 4

So above will start my java program.

If you give me some good learning stuff to createing init/rc script for linux -- that is very usefull for me.

arvind
0
arvind
Asked:
arvind
  • 5
  • 3
  • 2
  • +3
1 Solution
 
ahoffmannCommented:
/etc/init.d/skeleton

oops, RH .. is strange, think there it is somewhere in /etc/skel

just copy it, adapt to your requirements and put the java call in there.
0
 
arvindAuthor Commented:
nothing is there named like skel. Only one empty Directory called /etc/skel.


0
 
mmuserCommented:
?????
/etc/skel is a skeleton directory used to make user directories when new users are created, I think maybe he responded to the wrong post, since it has nothing to with your question.  you need to be more specific, are you saying you want this java program to start everytime you start the computer? then you need to place it at the end of /etc/rc.d/rc.local .  If you want some sort of script the you can run anytime then you need to learn to create rc scripts (things like loading deamon tools etc.) here are some links

(for SUSE but you should be able to make adjustments for RH)
http://www.bb-zone.com/zope/bbzone/docs/slgfg/part3/cha03/01_sec01

(google newsgroup link)
http://groups.google.com/groups?q=how+to+create+rc+scripts+redhat&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=slrn54juhu.g05.davidn%40sdev.blaze.net.au&rnum=1

Thanks!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arvindAuthor Commented:
no help tried both -- I created init script which will start the my program but while stoping its only kill the init processID -- So core java program still running
0
 
moduloCommented:
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/Q_20592203.html

Without a response in 72 hrs, a moderator will finalize this question by:

- Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
0
 
mmuserCommented:
Under the "stop:" section try adding something "killall Process_name" this should kill all processes that match that name. it's a little hackish but it should do it.
0
 
arvindAuthor Commented:
this is I'd tried before -- but it will kill all other application also -- As u know any java application running on linux will show process name JAVA. So if Tomcat is running on system its showing "JAVA" -- this is the reason I'm not using Killall -- If we use killall "Init script" it will close only init process...
0
 
ahoffmannCommented:
not killall but killproc is your friend, probably with the -G option
  man killproc
0
 
moduloCommented:
Active again so closure request denied.
When not solved, please post new CS question.

modulo

Community Support Moderator
Experts Exchange
0
 
arvindAuthor Commented:
Tried Killproc also -- but same case --I think I need to ask my developer to find the stop function JAVA code.
0
 
CleanupPingCommented:
arvind:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
arvindAuthor Commented:
please close this question and refund points.

My problem is still unsolved  - my linux daemon are stopping properly but java program which is called by daemom not killing.
0
 
Anthony PerkinsCommented:
This is how you do it:
Request a refund because no one answered your question (Delete)
http://www.experts-exchange.com/help.jsp#hi71
0
 
moduloCommented:
Saving this Q as a PAQ and refunding the 50 points to the questionner

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now