Perhaps you should have a closer look at the thread where it states:

 

> Can ne 1 tel me what will b the Process id for a
> > process that have been normaly terminated or
> > terminated by fource..

 

And in the next post it states:

 

     > i want to generate allerts for the process that r
      
> not running

 
Anyway first of please let me  know  how will the code know that a particular process has terminated � and kindly remember the process is neither a Zombie nor an Orphan.
Regards,
Satya Prakash Prasad
--- [EMAIL PROTECTED] wrote:

>
> You could have saved a lot of your valuable time if
> you had read...
> > > I need to send sms alert for the process that r
> > not
> > > running.
>
>
> Anyways that was very kind.
>
>
>
>
>
> Satya Prasad <[EMAIL PROTECTED]>
> 11/09/2004 02:58 PM
>
> Please respond to
> [EMAIL PROTECTED]
>
>
> To
> [EMAIL PROTECTED]
> cc
>
> Subject
> Re: [c-prog] Process iD. !!!URGENT......!!
>
>
>
>
>
>
>
> I will presume within my description 'alert' as
> 'signal' notification to the parent process when any
> child process exits.
>
> Unix shell provides an interface to the UNIX
> operating
> system. Commands are entered in one or more words
> separated by blanks. The Unix shell creates a new
> process using the system call fork() to execute the
> command as entered. The execution environment for
> the
> command includes input, output and the states of
> signals, and is established in the child process
> before the command is executed.
>
> Signals, are notifications sent to a process in
> order
> to notify it of various "important" events. They
> interrupt the process , and force it to handle it
> immediately. Each signal has an integer number that
> represents it (1, 2 and so on), as well as a
> symbolic
> name that is usually defined in the file
> /usr/include/signal.h.
>
> Each signal may have a signal handler, which is a
> function that gets called when the process receives
> that signal. The function is called in "asynchronous
> mode", meaning t hat nowhere in your program you have
> code that calls this function directly. Instead,
> when
> the signal is sent to the process, the operating
> system stops the execution of the process, and
> "forces" it to call the signal handler function.
> When
> that signal handler function returns, the process
> continues execution from wherever it happened to be
> before the signal was received, as if this
> interruption never occurred.
>
> Most signals may be caught by the process, but there
> are a few signals that the process cannot catch, and
> cause the process to terminate. If you install no
> signal handlers of your own , the runtime
> environment
> sets up a set of default signal handlers for your
> program.
>
> The signal requested in concern of this thread is
> 'SIGCHLD'. The 'SIGCHLD' signal is sent to parent on
> child st op or exit. The parent can be the Unix Shell
> or another process. Use 'trap' for catching the
> signal
> at Unix shell level
>
> At process level Unix provides many routines and
> methods of implementation. Below is a small example:
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main ( )
> {
> pid_t pid ;
> int times , status ;
> if ( pid=fork( ) )
> {
> printf ("PID = [%d]\n" , pid ) ;
> }
> else
> {
> sleep ( 5 ) ;
> exit ( EXIT_SUCCESS ) ;
> }
> if ( pid=fork( ) )
> {
> printf ("PID = [%d]\n" , pid ) ;
> }
> else
> {
> sleep ( 5 ) ;
> exit ( EXIT_SUCCESS ) ;
> }
>
> while ( (pid = wait ( &status ) ) > 0 )
> {
> printf ( "Child PID [%d] Killed\n" , pid ) ;
> }
> }
>
> The 'wait' subroutine waits for a child process to
> stop or terminate. The wait() function suspends
> execution of the calling process until status
> information for one of its terminated child
> processes
> is available, or until delivery of a signal whose
> action is either to execute a signal-catching
> function
> or to terminate the process. If status information
> is
> available prior to the call to wait(), return is
> immediate. The effect of the wait () function can be
> modified by setting the SIGCHLD signal. For example
> visit the following links:
> <http://www.erlenstar.demon.co.uk/unix/faq_2.html>
> <
> http://users.actcom.co.il/~choo/lupg/tutorials/multi-process/multi-process.html
> >
>
> Hope this helps.
>
> Regards,
> Satya Prakash Prasad.
>
>
> --- piyu sen <[EMAIL PROTECTED]> w rote:
>
> > Yes i have all of them
> >
> > [EMAIL PROTECTED] wrote:
> > >>>i want to generate allerts for the process that
> r
> > not running???
> >
> > So..Do you have a list of processes that should be
> > running???
> > Only then can you check which processes are
> running
> > and then send alerts for those that are not
> running!
> >
> >
> > Thanks.
> >
> >
> >
> > piyu sen <[EMAIL PROTECTED]>
> > 11/09/2004 12:39 PM
> > Please respond to
> > [EMAIL PROTECTED]
> >
> >
> > To
> > [EMAIL PROTECTED], [EMAIL PROTECTED],
> > [EMAIL PROTECTED] cc
> > Subject
> > Re: [c-prog] Process iD. !!!URGENT......!!
> >
> >
> >
> >
> > i want to generate allerts for the process that r
> > not running
> >
> > Mahesh Menase <[EMAIL PROTECTED]> wrote:
> > if process id is 0 then ...........
> >
> > :) ......... go Home.
> >
> > piyu sen <[EMAIL PROTECTED]> wrote:
> > ok
> > if the process id is 0 then
> >
> > Satya Prasad <[EMAIL PROTECTED]>
> wrote:
> >
> > I would like to help you ... but how can a
>
=== message truncated ===


Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com

To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=:HM/A=2376776/rand=856208406


Yahoo! Groups Links

Reply via email to