提交 b9a51f3f 编写于 作者: S Simon Fels 提交者: GitHub

Merge pull request #383 from morphis/f/collect-bug-info

Add simple script to collect various relevant log files for a bug report
#!/bin/sh -e
TMPDIR=$(mktemp -d)
if [ $(id -u) -ne 0 ] ; then
echo "WARNING: You're not running as root. This will prevent the script from"
echo " adding a few important file for bug diagnostics to the report."
echo " If you want to have a look at the script before giving it root"
echo " access, please have a look at $0."
echo
echo "Please press any key to continue"
read -r action
fi
echo "This script will collect a few interesting things which developers will"
echo "need to have a better insight into the Anbox system when something goes"
echo "wrong."
echo
echo "PLEASE NOTE: The collected log files may collect information about your"
echo "system. Please have a look before you're sending them to anyone!"
echo
echo "Collecting anbox log files ... "
set -x
# Collect several things which are of interest for bug reports
cp /var/snap/anbox/common/data/system.log $TMPDIR || true
cp /var/snap/anbox/containers/lxc-monitord.log $TMPDIR || true
cp /var/snap/anbox/logs/container.log $TMPDIR || true
anbox system-info > $TMPDIR/system-info.log 2>&1 || true
if [ -e /etc/systemd/system/snap.anbox.container-manager.service ]; then
sudo journalctl --no-pager -u snap.anbox.container-manager.service > $TMPDIR/container-manager.log 2>&1
fi
set +x
echo
echo "DONE!"
echo
echo "Do you want to include the kernel log of your system? [y/N]"
read -r action
if [ "$action" = "y" ]; then
set -x
dmesg > $TMPDIR/kernel.log 2>&1
set +x
fi
echo "Generating archive with all log files in $PWD ..."
CURDIR=$PWD
(cd $TMPDIR; tar cJf $CURDIR/anbox-system-diagnostics-$(date --rfc-3339=date --utc).tar.xz *)
rm -rf $TMPDIR
echo "DONE!"
echo
echo "Now please take the tarball generate in your current directory and"
echo "attach it to your bug report. Please don't hesitate to have a look"
echo "into the tarball before you do so to verify you don't leak any"
echo "information you don't want!"
......@@ -34,6 +34,8 @@ apps:
command: bin/container-manager.sh start
stop-command: bin/container-manager.sh stop
daemon: simple
collect-bug-info:
command: bin/collect-bug-info.sh
parts:
android-images:
......@@ -77,10 +79,12 @@ parts:
snap-wrapper.sh: bin/anbox-wrapper.sh
container-manager.sh: bin/container-manager.sh
anbox-bridge.sh: bin/anbox-bridge.sh
collect-bug-info.sh: bin/collect-bug-info.sh
prime:
- bin/anbox-bridge.sh
- bin/anbox-wrapper.sh
- bin/container-manager.sh
- bin/collect-bug-info.sh
apparmor:
plugin: nil
stage-packages:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册