From 0b917ba51fd34445b2d0b15e2ab7bb728472b852 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 6 Jun 2014 11:33:08 +1000 Subject: [PATCH] Use root to write syslog from journalctl We need to be root to write out the syslog data Change-Id: Ie958446c312d37fff9ebccfe352cfa0185e7a514 --- functions.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions.sh b/functions.sh index c3b80015..50c44684 100644 --- a/functions.sh +++ b/functions.sh @@ -364,7 +364,7 @@ function setup_host { elif is_fedora; then # save timestamp and use journalctl to dump everything since # then at the end - date +"%Y-%m-%d %H:%M:%S" > $BASE/log-start-timestamp.txt + date +"%Y-%m-%d %H:%M:%S" | sudo tee $BASE/log-start-timestamp.txt fi # Create a stack user for devstack to run as, so that we can @@ -422,8 +422,9 @@ function cleanup_host { elif is_fedora; then # the journal gives us syslog() and kernel output, so is like # a concatenation of the above. - sudo journalctl --since="$(cat $BASE/log-start-timestamp.txt)" \ - > $BASE/logs/syslog.txt + sudo journalctl --no-pager \ + --since="$(cat $BASE/log-start-timestamp.txt)" \ + | sudo tee $BASE/logs/syslog.txt > /dev/null fi # horizon