Mercurial > hg > plml
diff stdio_catcher @ 18:e0a1f92fcbc9
FIX: locking up due to multithreaded access during garbage collection.
author | samer |
---|---|
date | Mon, 06 Feb 2012 14:25:05 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdio_catcher Mon Feb 06 14:25:05 2012 +0000 @@ -0,0 +1,29 @@ +#!/bin/sh +echo "In stdio_catcher" + +function handle_term { + echo "### $(date): received SIGTERM" >> "$outputlog" + exit +} + +function handle_int { + echo "### $(date): received SIGINT" >> "$outputlog" +} + +function handle_hup { + echo "### $(date): received SIGHUP" >> "$outputlog" + exit +} + +trap handle_int 2 +trap handle_term 15 +trap handle_hup 1 + +inputlog="$1" +outputlog="$2" +shift 2 + +echo "### $(date): INPUT - $@" >> "$inputlog" +echo "### $(date): OUTPUT - $@" >> "$outputlog" +nohup tee -a "$inputlog" | "$@" | nohup tee -a "$outputlog" +#"$@"