How detect when process finishes

How detect when process finishes

Post by Dean Dan » Thu, 18 Jan 2001 09:57:59



I would like to send an email message to my pager notifying me when a
process finishes. How can I detect when a process finishes? I'm running
AIX 4.2.1 using korn shell. Thanks. -Dean

Sent via Deja.com
http://www.deja.com/

 
 
 

How detect when process finishes

Post by dave_g3.. » Thu, 18 Jan 2001 22:21:48




Quote:> I would like to send an email message to my pager notifying me when a
> process finishes. How can I detect when a process finishes? I'm
running
> AIX 4.2.1 using korn shell. Thanks. -Dean

> Sent via Deja.com
> http://www.deja.com/

Hi Dean,

A quick and Dirty script I use (Solaris 2.6) follows.  I call the
process from a script and just keep checking every 5 secs if it is
still there.

#!/bin/ksh
. $HOME/myprocess 2>/dev/null &
PID=$!
#echo $PID
while sleep 5
do
  ps -p$PID >/dev/null
  if [ $? != 0 ]
  then
    echo "Call My Pager Here If I Had One"
    exit 1
  fi
done

Don't if this is any use to you?

  /Dave

Sent via Deja.com
http://www.deja.com/

 
 
 

How detect when process finishes

Post by Casper H.S. Dik - Network Security Engine » Thu, 18 Jan 2001 22:58:46


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>I would like to send an email message to my pager notifying me when a
>process finishes. How can I detect when a process finishes? I'm running
>AIX 4.2.1 using korn shell. Thanks. -Dean

while "kill -0 $pid"
do
        sleep 10
done

pageme "Process $pid exited"

On Solaris, you would use "pwait $pid", perhaps AIX has a similar
cheap mechanism.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

How detect when process finishes

Post by Kurt J. Lanz » Thu, 18 Jan 2001 23:41:55



> I would like to send an email message to my pager notifying me when a
> process finishes. How can I detect when a process finishes? I'm running
> AIX 4.2.1 using korn shell. Thanks. -Dean

Run it inside a wrapper:

        #!/bin/sh
        process_you_want_to_run
        echo It finished | mail yourself

What could be easier?

 
 
 

How detect when process finishes

Post by sto.. » Fri, 19 Jan 2001 01:30:46


Why not use a wrapper script?

#!/bin/ksh
$HOME/myprocess 2>/dev/null
echo "Call My Pager with exit status: $?"
exit





> > I would like to send an email message to my pager notifying me when
a
> > process finishes. How can I detect when a process finishes? I'm
> running
> > AIX 4.2.1 using korn shell. Thanks. -Dean

> > Sent via Deja.com
> > http://www.deja.com/

> Hi Dean,

> A quick and Dirty script I use (Solaris 2.6) follows.  I call the
> process from a script and just keep checking every 5 secs if it is
> still there.

> #!/bin/ksh
> . $HOME/myprocess 2>/dev/null &
> PID=$!
> #echo $PID
> while sleep 5
> do
>   ps -p$PID >/dev/null
>   if [ $? != 0 ]
>   then
>     echo "Call My Pager Here If I Had One"
>     exit 1
>   fi
> done

> Don't if this is any use to you?

>   /Dave

> Sent via Deja.com
> http://www.deja.com/

Sent via Deja.com
http://www.deja.com/
 
 
 

1. system call starting next process before first process is finished.

Hello,
I have a c++ program which has infinite loop.
Inside the loop I have some code which gets the data file when it
arrives it starts a process using system call.  When there are two
files available, it starts two processes with two files at one given
time, without waiting first to finish. It works fine but I want to
wait on the the system call. i.e I want the system to call to finish
first process and then it should continue and if there is second file
then it should start second process by using system call.

Please help me in fisxing this problem
Thanks in advance
Ravi Bhave

++++++++++++++++++++++++++++++++++++++++++++++++++++
for (;;)
{
    if file exists in a direectory
    {
          system(program, filename);
    }
++++++++++++++++++++++++++++++++++++++++++++++++++++++

2. Matrox G400 TV-out no mouse cursor!?

3. How do I detect when Demon have finished sending me mail?

4. Sharing a tip/cu/mterm line???

5. detecting process death from unrelated process

6. Hanging at boot OSR 5.0.2

7. Redirecting a process or detecting a process?

8. Always return the same ServerName??

9. Running Processes After Others Finish

10. Wait for process to finish

11. PID after process is finished

12. Q:background process finished ssignal?

13. Process finish notification