Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    catching singnals in a shellscript from a other prozess


    i want to know when a prozess was terminated with a SIGTERM. I want to use a csh Script who knows the PID of the prozess. If the Prozess was killed the script should do somthing but if the prozess dies himself the script should do somthing else.

    Is there sombody who know a way to catch the signals who was sendet to an other Prozess (Not parent or child).


  2. #2
    You could execute the program using a scripting language like perl and then check the child error.

    # run some command
    $processList = `ps -ax`;

    # check $? for child error
    if($?) {
    #do this

    The child error would be the returned status of the wait system call... so you could determine how the process ended.

    Hope this is correct... hope it helps.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts