]> spindle.queued.net Git - xodist/blobdiff - functions.sh
initchroot: use tee to log to $ROOTDIR.log
[xodist] / functions.sh
index 46705f6f3787ba635bcc9ae19af0d61ce2692ec5..b6714e57ec86b28f71ccc9ee155226c293baffe9 100644 (file)
@@ -114,3 +114,13 @@ chroot_internal_umounts()
     umount ${root_dir}/dev/pts
     umount ${root_dir}/var/cache/apt/cache
 }
+
+start_logging()
+{
+    logpipe="$1".pipe
+    trap "rm -f $logpipe" 0
+    mknod $logpipe p
+    tee "$1".log <$logpipe &
+    trap "kill $!; rm -f $logpipe" 0
+    exec >$logpipe 2>&1
+}