Make a named pipe (which we clean up on exit or script death), set our
stdout/stderr to it, and pipe it tee so we can see what's happening and
log at the same time.
Signed-off-by: Andres Salomon <dilinger@debian.org>
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
+}
usage
fi
+start_logging $ROOT_DIR
+
check_for_cmds debootstrap || exit 1
if [ -z "${LOCAL_APT_MIRROR}" ]; then