[progress Communities] [progress Openedge Abl] Forum Post: How To Trap The Signals Sent To...

  • Thread starter Thread starter George Potemkin
  • Start date Start date
Status
Not open for further replies.
G

George Potemkin

Guest
I'd like to trap a signal sent to a process launched by my shell (namely to a Progress session but let's start just with another shell): TrapLog=trap.log TrapAction() { echo "`date '+%Y/%m/%d %H:%M:%S'` PID: $$" >>$TrapLog ps -fp $$ >>$TrapLog ps -ef | awk '$3 == "'$$'" {print}' >>$TrapLog } test -f $TrapLog && rm -f $TrapLog trap TrapAction 15 echo Shell PID1=$$ trap sh echo Shell PID2=$$ trap Sub-process (PID2) obviously ignores the trap command used in the parent shell (PID1). Moreover the parent shell postpones the reaction specified in the trap until I'll kill the sub-process: date; kill -15 sleep 5 date; kill -9 cat trap.log Time in trap.log created by PID1 matches the time of kill PID2 command. If I'll comment out the start of the sub-process (sh) then the trap works as expected. What I'm doing wrong?

Continue reading...
 
Status
Not open for further replies.
Back
Top