Skip to content

Commit 4eb455a

Browse files
committed
Capture the content of 'audit.log' file
On CentOS/ Fedora machines, this can be useful when QEMU silently fails to start up due to SELinux denials. For Debian-based machines, which use AppAromor, DevStack already captures the output of 'kern.log' (via `journalctl -t kernel` redirected into 'syslog.txt.gz'). Change-Id: I231b22664f0944b905e00568759785615a1d47c3 Acked-by: Clark Bolyan <clark.boylan@gmail.com> Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
1 parent 72f6322 commit 4eb455a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.zuul.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
'{{ stage_dir }}/core': logs
219219
'{{ stage_dir }}/listen53.txt': logs
220220
'{{ stage_dir }}/deprecations.log': logs
221+
'{{ stage_dir }}/audit.log': logs
221222
/var/log/ceph: logs
222223
/var/log/openvswitch: logs
223224
/var/log/glusterfs: logs

roles/capture-system-logs/tasks/main.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@
1919
rpm -qa | sort > {{ stage_dir }}/rpm-qa.txt
2020
fi
2121
22+
# NOTE(kchamart) The 'audit.log' can be useful in cases when QEMU
23+
# failed to start due to denials from SELinux — useful for CentOS
24+
# and Fedora machines. For Ubuntu (which runs AppArmor), DevStack
25+
# already captures the contents of /var/log/kern.log (via
26+
# `journalctl -t kernel` redirected into syslog.txt.gz), which
27+
# contains AppArmor-related messages.
28+
if [ -f /var/log/audit/audit.log ] ; then
29+
sudo cp /var/log/audit/audit.log {{stage_dir }}/audit.log &&
30+
chmod +r {{ stage_dir }}/audit.log;
31+
fi
32+
2233
# gzip and save any coredumps in /var/core
2334
if [ -d /var/core ]; then
2435
sudo gzip -r /var/core

0 commit comments

Comments
 (0)