File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/sh
2- # Fix ownership of the data dir (bind mounts are often owned by root),
3- # then drop privileges and run as the unprivileged monitor user.
2+ # Fix ownership AND permissions of the data dir (bind mounts are often
3+ # owned by root or lose mode bits), then drop privileges and run as the
4+ # unprivileged monitor user.
45set -e
56
67DATA_DIR=" $( dirname " ${LOG_FILE:-/ app/ data/ status.txt} " ) "
78mkdir -p " $DATA_DIR " 2> /dev/null || true
89chown -R monitor:monitor " $DATA_DIR " 2> /dev/null || true
10+ # ensure the owner can traverse/write the dir (x bit is required to open files inside)
11+ chmod u+rwx " $DATA_DIR " 2> /dev/null || true
912
10- # if the targets file is read-only and unreadable, that's fine — the app will error clearly
1113exec su-exec monitor:monitor /app/TinyUptimeRobot " $@ "
You can’t perform that action at this time.
0 commit comments