Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run script changes ownership to root #11

Open
bdr99 opened this issue Jun 23, 2020 · 3 comments
Open

run script changes ownership to root #11

bdr99 opened this issue Jun 23, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@bdr99
Copy link

bdr99 commented Jun 23, 2020

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
@tribut
Copy link
Owner

tribut commented Jun 23, 2020

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.

@tribut tribut added the enhancement New feature or request label Jun 23, 2020
@bdr99
Copy link
Author

bdr99 commented Jun 23, 2020

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.

@nikc547
Copy link

nikc547 commented Mar 18, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants