LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2007, 05:02 AM   #1
c_golan
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
Daemons question


Hi,

I have an application that in general I want it to be always up. Therefore I tought of using the inittab in order to define it there with a respawn.
On the other hand, it might be that the user will need to shutdown this application (for example during maintanence, upgrades etc.) Therefor I need the ability to allow him to do so, and I tought define it under the /etc/rc.d/rc.X directories so the user can activate or deactivate it.
My question - Since I understand that the respawn takes care that the process will be restarted automatically when it is down (crashed or stopped by the user), how can I give solution for both requirments (keeps that the process will be restarted when it crashed, but do nothing when it is stopped in purpose by the user?

Thanks in advance
 
Old 10-02-2007, 05:53 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Well, you could use some kind of flag file, but that could be problematic with respawn ie it'll keep try to restart, which you don't want.
What you can do (less frantic) is put a job in cron that checks for the job every eg 5 mins and restarts it if not up.
Use a crontab that the user can edit, so he can comment out the job when he doesn't want a restart.
Possibly look at sudo if job HAS to run as root.
 
Old 10-07-2007, 03:23 AM   #3
c_golan
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks

Thanks for th help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Daemons and Server Load question RavenLX Programming 4 08-08-2007 08:25 PM
daemons cnm Linux - Newbie 4 11-08-2006 07:12 AM
daemons LinuxLala Linux - General 4 11-28-2003 01:37 PM
Daemons mariua Linux - Newbie 0 10-11-2001 05:00 AM
daemons acren Linux - Security 3 07-06-2001 04:28 AM


All times are GMT -5. The time now is 03:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration