[TriLUG] Re: correction: process monitoring

Brent Verner brent at rcfile.org
Sat Jan 18 05:56:40 EST 2003


[2003-01-18 05:09] James Manning said:
| > [Michael Mueller]
| > Anybody think of another way to accomplish this?
| 
| killall -0 procname and check $?
| pidof procname and check $? or check for output
| 
| jmm at xanex:/home/jmm> for i in bash xxx; do
| > killall -q $i && echo There is a $i process running
| > done
| There is a bash process running
| jmm at xanex:/home/jmm>

or pidof(8) could be used...

sh$ if pidof $someproc >/dev/null 2>&1; then
  >   echo "$someproc is running"
  > fi
bash is running

  b

-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman



More information about the TriLUG mailing list