LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-27-2002, 03:17 PM   #1
civiltongue
LQ Newbie
 
Registered: Aug 2002
Posts: 4

Rep: Reputation: 0
Hi rel process


I'm using a special-purpose process I wrote, running on a Linux server, to support a piece of telecom hardware. Being telecom, high reliability in an unattended environment is critical.

If the process should crash for any reason, I'd like Linux to restart it. If the whole machine has a power failure, when power comes back I want Linux to boot itself and restart my process. How do I make these things happen?

I'm using RH 7.2 in a server configuration (i.e., no GUI or desktop).
 
Old 08-27-2002, 03:43 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You could tie it to init (inittab) or use HW/SW watchdog (kernel support). Boot thing is a BIOS setting AFAIK, and unless there's a e2fsck process in the way everything should be up 'n running again.
 
Old 08-27-2002, 04:38 PM   #3
civiltongue
LQ Newbie
 
Registered: Aug 2002
Posts: 4

Original Poster
Rep: Reputation: 0
Can you elaborate on HW/SW watchdog?
 
Old 08-27-2002, 04:58 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Never had a HW watchdog but the purpose is the same as the SW kind, a tool configured to "watch"/repair other processes. You can configure it to reboot under high load, watch the motherboards sensors, watch processes for existence etc, etc. It's launched tru the usual SYSV init process, and tries to write to /dev/watchdog and if it can't (due to overload for instance) it can be set to start/kill off processes.

Selection for SW watchdog is in the kernel config, a link to the source is in the kernel docs.

From the man page:
DESCRIPTION
Watchdog is a daemon that checks if your system is still
working. If programs in user space are not longer executed it will hard reset the system. (This means like when it can't repair the system state)

The kernel provides /dev/watchdog, which when open must be written to within a minute or the machine will reboot.
Each write delays the reboot time another minute. After a minute the watchdog hardware will cause the reset. In the
case of the software watchdog the ability to reboot will
depend on the state of the machines and interrupts.

Watchdog can be stopped without causing a reboot if the
device /dev/watchdog is closed correctly, unless of course
your kernel is compiled with the CONFIG_WATCHDOG_NOWAYOUT option enabled.


TESTS
Watchdog itself does several additional tests to check the
system status:
Check whether the process table is full.
Check whether there is enough free memory available.
Check whether some given files are accessible.
Check whether some given files change in a given interval.
Check whether the average work load exceeds a predefined maximal value.
Check whether the a file table overflow occurred.
Check whether a given process (specified by a pid file) is still running.
(etc etc)

HTH somehow.
*Btw, don't make the mistake I made using a scripted "check/repair" tool. If the system eats resources (testing forkbombs) it won't cope :-]
 
Old 08-28-2002, 11:17 AM   #5
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 31
Just put it in /etc/inittab as a "respawn":

mypg:3:respawn:/usr/local/bin/myprogram

Make sure the program is designed to run in the background though.
 
  


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
Nvidia Kernel Rel. 7667 webterractive Mandriva 12 07-19-2005 10:43 AM
Which rel. of libpcap for RH9????? DeepakRajendran Linux - General 2 04-13-2005 01:10 AM
RedHat 9.0 2.4.20-8 - Problems with Belkin F5D6020 rel. 2 saad0914 Linux - Networking 1 04-16-2004 03:50 PM
RedHat 9.0 2.4.20-8 - Problems with Belkin F5D6020 rel. 2 saad0914 Linux - Wireless Networking 0 04-16-2004 03:46 PM
Not really rel. to Linux VMware Prob on Mandrake 8.2 aaronluke Linux - Distributions 0 09-26-2002 08:14 PM

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

All times are GMT -5. The time now is 12:58 AM.

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