[Lunar-commits] <lunar> Prevent lin logging process to stay behind

Peter de Ridder peter at lunar-linux.org
Mon Jul 9 23:34:15 CEST 2012


commit ef928a8d29b4c0c66ddb5b4f854681cb0e7b3d9e
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Mon, 09 Jul 2012 14:34:15 -0700
URL: https://github.com/lunar-linux/lunar/commit/ef928a8d29b4c0c66ddb5b4f854681cb0e7b3d9e

Prevent lin logging process to stay behind
---
  libs/logging.lunar                                           +6/-4     
  1 files changed, 6 insertions (+), 4 deletions (-)

--- a/libs/logging.lunar
+++ b/libs/logging.lunar
@@ -25,6 +25,8 @@ start_logging () {
 
 stop_logging() {
   debug_msg "stop_logging ($@)"
+  # Make sure the FIFO gets closed
+  echo > $C_FIFO
   echo "++ Mark Compile stop   : \"$MODULE\" \"$VERSION\" \"$(date -Ru)\"" >> $C_LOG
   message  "${MESSAGE_COLOR}Creating"                        \
            "${FILE_COLOR}$COMPILE_LOGS/$MODULE-$VERSION.bz2"  \
@@ -88,12 +90,12 @@ activate_voyeur()  {
   debug_msg "activate_voyeur ($@)"
   if [ -z "$SILENT" ] ; then
     case $VOYEUR in
-      on) tee -a $C_LOG < $C_FIFO              & ;;
-      p*) tee -a $C_LOG < $C_FIFO | progress   & ;;
-       *) tee -a $C_LOG < $C_FIFO >/dev/null   & ;;
+      on) ( tee -a $C_LOG < $C_FIFO            ; rm -f "$C_FIFO" ) & ;;
+      p*) ( tee -a $C_LOG < $C_FIFO | progress ; rm -f "$C_FIFO" ) & ;;
+       *) ( tee -a $C_LOG < $C_FIFO >/dev/null ; rm -f "$C_FIFO" ) & ;;
     esac
   else
-    tee -a $C_LOG < $C_FIFO >/dev/null &
+    ( tee -a $C_LOG < $C_FIFO >/dev/null ; rm -f "$C_FIFO" ) &
   fi
 }
 




More information about the Lunar-commits mailing list