homeassistant-docker-venv
homeassistant-docker-venv copied to clipboard
run script changes ownership to root
I noticed that whenever I start the HA container, the run script changes ownership to root. Even if I change it to be owned by my user, when I restart the container again, it changes back to root. Is there a way to keep this file owned by my user?
$ ls -l data/docker/run
-rwxr-xr-x 1 root root 2089 Jun 22 21:32 data/docker/run
$ sudo chown brandon:brandon data/docker/run
$ ls -l data/docker/run
-rwxr-xr-x 1 brandon brandon 2089 Jun 22 21:32 data/docker/run
$ docker-compose restart
Restarting home-assistant ... done
$ ls -l data/docker/run
-rwxr-xr-x 1 root root 2089 Jun 22 21:32 data/docker/run
Thanks for getting in touch. This seems to be something that s6 (the new init system used by the home-assistant docker image) does, I'll see if I can do anything about it.
Thanks @tribut! By the way, I tried changing the volume mount to be read-only, like this:
volumes:
- ./data:/config
- ./data/docker/run:/etc/services.d/home-assistant/run:ro
It seemed to work. I did see this in the logs:
s6-chown: fatal: unable to chown /var/run/s6/etc/services.d/home-assistant/run: Read-only file system
s6-chmod: fatal: unable to change mode of /var/run/s6/etc/services.d/home-assistant/run: Read-only file system
Despite these log entries though, everything seemed to work fine. The ownership of the run script didn't change, and the app did run as my user instead of root. So maybe this is the easiest fix.
volumes: - ./data:/config - ./data/docker/run:/etc/services.d/home-assistant/run:ro
Hi! I tried changing it too, and it doesn't work for me.
data/docker/run run as root