LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Ping (https://www.linuxquestions.org/questions/linux-general-1/ping-41814/)

snoopy42 01-17-2003 10:56 AM

Ping
 
Does anybody know a kind of pinging feature to Kernel?
I'd like to have a system where my application keeps pinging to Kernel periodically and Kernel does something if the application stops pinging.

trickykid 01-17-2003 12:21 PM

What do you mean by pinging the kernel ? What are you trying to accomplish ?

snoopy42 01-17-2003 02:26 PM

Ping
 
I have a system like this.

Application-A is running and keeps pinging to hardware every 30 seconds.

Application-A can ping to hardware by using a function provided by the hardware company.

If Application-A got frozen and can't ping for a certain time, the harware's watchdog works and reboots the whole system.

I'm going to implement another system that doesn't have any function to ping to hardware.

I'm wondering if I can have application-A inform its current status to Kernel and Kernel can make the system reboot or do something if Kernel doesn't get anything from application-A for a certain time.

tinesthai 01-17-2003 03:21 PM

Its still a little confusing. What are you trying to accomplish?
Are you concerned about keeping a machine up, or are you concerned with insuring a specific application is running?

Either way, I think the easiest way is to write a couple of perl scripts.
You might change your approach to the scripts a little depending on your primary concerns.

michaelk 01-17-2003 04:00 PM

A software watchdog timer.

snoopy42 01-17-2003 05:00 PM

Ping
 
Sorry that I confused everybody.

I want to enable the system recover when my application doesn't run properly.
When you turn on the computer, my system starts and my application runs automatically. I don't want customers to touch the system. Nobody can rerun the application. It should recover when my application has any problems.
How to recover may be to rerun a specific application or reboot the system itself.

I'd like to know if my application runs and sends some information or stops its job.

By the way, would you please expalin a software watchdog timer?
It is Kernel's feature? or can I download some software?

dpembrook 01-17-2003 06:26 PM

For the worst case scenario, if the computer fails to respond. You could take a basic stamp processor:

See: http://www.parallax.com/

1) Have the "pinging" program toggle a bit on and off on a serial or parallel port

2) Write a program for the stamp processor to watch for the bit to go on and off, If it doesn't enable the reset on the motherboard to the PC.

This would be in hardware and work independent of the computer.

Use the same approach (setting a value to 1 then 0 on a timer) in software with a Perl script or something and reset the application with the script should the application fail.

If this is a network service, you still should be checking externally to see if clients can connect and interact with the service.

mcleodnine 01-17-2003 06:34 PM

MaicaelK said it best - the software watchdog is a good start. You can configure this in your kernel but you should read up on it first.

Daniel J. Bernstien has written a pretty comprehensive set of UNIX tools which you migh also want to have alook at called daemontools. Try a google search.

Some motherborads (Intel-based) may also have a built-in watchdog timer which can be configured to halt the machine if a clock value isn't constantly reset. I've never had the opprtunity to play with it but you can read up on this in the kernel source Documentation.

snoopy42 01-21-2003 06:25 PM

Ping : watchdog
 
I appreciate every response.
I decided to install watchdog-5.2.tar.gz.

I rebuilt kernel because I set "y" to watchdog timer support and software watchdog.

1. cd /usr/src/linux-2.4.7-10
2. make xconfig
3. set "y" to Watchdog Timer Support, Disable watchdog shutdown on close, Software Watchdog
4. make dep
5. make clean
6. make bzImage
7. make modules
8. make modules_install

I succeded in rebuilding part.

Then, I installed watchdog-5.2.tar.gz.
1. tar zxvf watchdog-5.2.tar.gz
2. cd watchdog-5.2
3. ./configure
4. make
5. make install

I also made special file.
1. cd /dev
2. mknod watchdog c 10 130

I changed watchdog.conf to use /dev/watchdog.

Then I excuted watchdog. watchdog shows up when I type "ps -ax".

However, I got an error and /var/log/messages says
wdt: IRQ 11 is not free.
IRQ 11 is asigned statically in wdt.c

IRQ 11 is used for usb in my machine.

Should I change wdt.c and compile it?

wdt.c is /usr/modules/2.4.7-10/kernel/drivers/char

I'm beginner and never modified any source code.


All times are GMT -5. The time now is 08:22 AM.