Use root to write syslog from journalctl

We need to be root to write out the syslog data

Change-Id: Ie958446c312d37fff9ebccfe352cfa0185e7a514
This commit is contained in:
Ian Wienand
2014-06-06 11:33:08 +10:00
parent d7ea2342f5
commit 0b917ba51f

View File

@@ -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