Give user access to system logs in container.sh

Part of #152
This commit is contained in:
Girish Ramakrishnan
2016-12-20 20:49:57 -08:00
parent 4a99eb105a
commit 148c8e6250
2 changed files with 9 additions and 6 deletions
+9
View File
@@ -4,11 +4,20 @@ set -eu -o pipefail
# This file can be used in Dockerfile
readonly USER=yellowtent
readonly container_files="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/container"
readonly CONFIG_DIR="/home/yellowtent/configs"
readonly DATA_DIR="/home/yellowtent/data"
# Give user access to system logs
usermod -a -G systemd-journal ${USER}
mkdir -p /var/log/journal # in some images, this directory is not created making system log to /run/systemd instead
chown root:systemd-journal /var/log/journal
systemctl restart systemd-journald
setfacl -n -m u:${USER}:r /var/log/journal/*/system.journal
########## create config directory
rm -rf "${CONFIG_DIR}"
sudo -u yellowtent mkdir "${CONFIG_DIR}"