diff options
Diffstat (limited to 'packaging/docker/run.sh')
-rwxr-xr-x | packaging/docker/run.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh index 244f92c421..9029e22b61 100755 --- a/packaging/docker/run.sh +++ b/packaging/docker/run.sh @@ -49,10 +49,12 @@ if mountpoint -q /etc/netdata && [ -z "$(ls -A /etc/netdata)" ]; then cp -a /etc/netdata.stock/. /etc/netdata fi -if mountpoint -q /etc/netdata; then - hostname > /etc/netdata/.container-hostname -else - rm -f /etc/netdata/.container-hostname +if [ -w "/etc/netdata" ]; then + if mountpoint -q /etc/netdata; then + hostname >/etc/netdata/.container-hostname + else + rm -f /etc/netdata/.container-hostname + fi fi if [ -n "${NETDATA_CLAIM_URL}" ] && [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ ! -f /var/lib/netdata/cloud.d/claimed_id ]; then |