5 if [ $(id -u) -ne 0 ] ; then
6 echo "WARNING: You're not running as root. This will prevent the script from"
7 echo " adding a few important file for bug diagnostics to the report."
8 echo " If you want to have a look at the script before giving it root"
9 echo " access, please have a look at $0."
13 echo "This script will collect a few interesting things which developers will"
14 echo "need to have a better insight into the Anbox system when something goes"
17 echo "PLEASE NOTE: The collected log files may collect information about your"
18 echo "system. Please have a look before you're sending them to anyone!"
20 echo "Collecting anbox log files ... "
23 # Collect several things which are of interest for bug reports
24 cp /var/snap/anbox/common/data/system.log $TMPDIR || true
25 cp /var/snap/anbox/common/containers/lxc-monitord.log $TMPDIR || true
26 cp /var/snap/anbox/common/logs/container.log $TMPDIR || true
27 cp /var/snap/anbox/common/logs/console.log* $TMPDIR || true
28 $SNAP/command-anbox.wrapper system-info > $TMPDIR/system-info.log 2>&1 || true
30 if [ -e /etc/systemd/system/snap.anbox.container-manager.service ]; then
31 sudo journalctl --no-pager -u snap.anbox.container-manager.service > $TMPDIR/container-manager.log 2>&1 || true
39 echo "Do you want to include the kernel log of your system? [y/N]"
41 if [ "$action" = "y" ]; then
43 dmesg > $TMPDIR/kernel.log 2>&1
47 echo "Generating archive with all log files in $PWD ..."
49 (cd $TMPDIR; zip -r $CURDIR/anbox-system-diagnostics-$(date --rfc-3339=date --utc).zip *)
54 echo "Now please take the ZIP archive generated in your current directory"
55 echo "and attach it to your bug report. Please don't hesitate to have a"
56 echo "look into the archive before you do so to verify you don't leak any"
57 echo "information you don't want!"