LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-06-2011, 08:57 AM   #1
rumal
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Rep: Reputation: Disabled
Running control scripts as daemons


Hello, I'm working with debian squeeze in an embedded system that have an ARMv5 on it.

I need to maintain active several programs, they always have to be running, and if they die, no matter what happend, they must be launched again.

Now I have one script for each program that basically do this:
Code:
#!/bin/bash

cd /opt/
java -jar myProgram.jar

exit 0
And then I call all the script from etc/inittab whith respawn. That work fine for me, but I think that there is a better way to do this...
 
Old 06-06-2011, 07:38 PM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
This solution does what you said you need, and it uses few
resources. In what way do you want to improve on this?
 
Old 06-06-2011, 08:49 PM   #3
rumal
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
I'd like to do in a more standard or robust way.
 
Old 06-07-2011, 06:15 AM   #4
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
That is the standard way. And it's very robust.

The other common way to do this is to have a process running that
just checks to see if it needs to restart the original process.
The advantage of this method is that it gives you the option to
do other things such as send email or submit a log entry. This
method is less robust, but can be customized as needed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running nfs daemons methodtwo Linux - Server 1 05-10-2008 10:09 AM
What daemons are running? paul123 Linux - Newbie 2 01-09-2007 04:19 PM
daemons & hotplug scripts mikaelo Programming 9 05-25-2004 10:15 PM
whats diff b/w process,daemons,scripts dark_light Linux - General 2 07-19-2002 05:11 PM
whats diff b/w process,daemons,scripts dark_light Linux - General 1 07-19-2002 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration