LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
[stats]
From: <michaeld@senet.com.au>
To : Horst Poehlmann <Horst.Poehlmann@pobox.com>
<linuxsa@linuxsa.org.au>
Date: Fri, 29 Jun 2001 05:46:09 GMT
Re: ps and processes
Horst wrote:
> I run a program that monitors if a process is still running. It works
> for a while and then tells me that the process has died even though it's
> still running. I know why, but I would like to solve it. Basically what
> happens is that I grep for a line to match a certain pattern. eg.
>
> root 29437 0.0 0.3 4356 3224 ? S Jun24 0:00 perl
/usr/bin/swatch -c
/root/.swatchrc some other params here...
> root 29438 0.0 0.3 4344 3212 ? S Jun24 0:00 perl
/usr/bin/swatch -c
/root/.swatchrc.page some other params here...
>
> I'm basically grepping for .swatchrc and .swatchrc.page (I'm monitoring
> them seperately).
>
> After a few days however, those processes get swapped out to memory and
> I get the following:
>
> root 29437 0.0 0.0 4356 0 ? SW Jun24 0:00 [perl]
> root 29438 0.0 0.0 4344 0 ? SW Jun24 0:00 [perl]
[snip]
Grab the PID when you can see the parms (ie when you first run) and monitor the
existance or not of that PID. You could even check the PPID as well to ensure
that it didn't die and another process started up in it's place (unlikely
anyhow).
Cheers,
Michael...
--
michaeld@senet.com.au
Now you owe me one Horst - now about ssh... :-)
-------------------------------------------
This message was sent using SE Net Webmail.
http://webmail.senet.com.au/
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
[stats]
Return to the LinuxSA Mailing List Information Page