?
Solved

need a RC script

Posted on 2003-03-27
14
Medium Priority
?
305 Views
Last Modified: 2013-12-15
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
Comment
Question by:arvind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +3
14 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 8223661
/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
 
LVL 5

Author Comment

by:arvind
ID: 8237882
nothing is there named like skel. Only one empty Directory called /etc/skel.


0
 

Expert Comment

by:mmuser
ID: 8248052
?????
/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
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 
LVL 5

Author Comment

by:arvind
ID: 8372132
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
 

Expert Comment

by:modulo
ID: 8383531
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
 

Expert Comment

by:mmuser
ID: 8390192
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
 
LVL 5

Author Comment

by:arvind
ID: 8392843
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 8393756
not killall but killproc is your friend, probably with the -G option
  man killproc
0
 

Expert Comment

by:modulo
ID: 8400223
Active again so closure request denied.
When not solved, please post new CS question.

modulo

Community Support Moderator
Experts Exchange
0
 
LVL 5

Author Comment

by:arvind
ID: 8400241
Tried Killproc also -- but same case --I think I need to ask my developer to find the stop function JAVA code.
0
 

Expert Comment

by:CleanupPing
ID: 9076583
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
 
LVL 5

Author Comment

by:arvind
ID: 10339408
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
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 10342313
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
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10342973
Saving this Q as a PAQ and refunding the 50 points to the questionner

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question