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

fix(Dockerfile): Fix permission issue for startup script #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bugwelle
Copy link

@bugwelle bugwelle commented Nov 7, 2023

The startup script could not be started (in my case) because of permission issues. Looking at the log, I saw:

rssreader                | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
rssreader                | [s6-init] ensuring user provided files have correct perms...exited 0.
rssreader                | [fix-attrs.d] applying ownership & permissions fixes...
rssreader                | [fix-attrs.d] done.
rssreader                | [cont-init.d] executing container initialization scripts...
rssreader                | [cont-init.d] 50-php: executing... 
rssreader                | [cont-init.d] 50-php: exited 0.
rssreader                | [cont-init.d] 98-wait-for-db: executing... 
rssreader                | Checking database responds within 1s on postgres:5432...
rssreader                | [cont-init.d] 98-wait-for-db: exited 0.
rssreader                | [cont-init.d] 99-ttrss: executing... 
rssreader                | /var/run/s6/etc/cont-init.d/99-ttrss: line 2: ./setup-ttrss.sh: Permission denied
rssreader                | [cont-init.d] 99-ttrss: exited 126.
rssreader                | [cont-init.d] done.
rssreader                | [services.d] starting services
rssreader                | ./run: cd: line 4: can't cd to /var/www/ttrss: No such file or directory
rssreader                | nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/nginx.conf:39

By passing --chown, we set the file owner to what s6 expects.

The startup script could not be started (in my case) 
because of permission issues. Looking at the log, I saw:

```
rssreader                | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
rssreader                | [s6-init] ensuring user provided files have correct perms...exited 0.
rssreader                | [fix-attrs.d] applying ownership & permissions fixes...
rssreader                | [fix-attrs.d] done.
rssreader                | [cont-init.d] executing container initialization scripts...
rssreader                | [cont-init.d] 50-php: executing... 
rssreader                | [cont-init.d] 50-php: exited 0.
rssreader                | [cont-init.d] 98-wait-for-db: executing... 
rssreader                | Checking database responds within 1s on postgres:5432...
rssreader                | [cont-init.d] 98-wait-for-db: exited 0.
rssreader                | [cont-init.d] 99-ttrss: executing... 
rssreader                | /var/run/s6/etc/cont-init.d/99-ttrss: line 2: ./setup-ttrss.sh: Permission denied
rssreader                | [cont-init.d] 99-ttrss: exited 126.
rssreader                | [cont-init.d] done.
rssreader                | [services.d] starting services
rssreader                | ./run: cd: line 4: can't cd to /var/www/ttrss: No such file or directory
rssreader                | nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/nginx.conf:39
```

By passing `--chown`, we set the file owner to what s6 expects.
@bugwelle
Copy link
Author

bugwelle commented Nov 7, 2023

FYI @x86dev : Even if I fix this issue, I still get an issue with FPM:

rssreader                | [07-Nov-2023 10:18:15] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address in use (98)
rssreader                | [07-Nov-2023 10:18:15] ERROR: FPM initialization failed

Did you encounter that before?

@aashley
Copy link

aashley commented Nov 15, 2023

@bugwelle add -F to the exec php-fpm in the php run file, so it doesn't detach and s6 can manage it.

alpine changed default behaviour with 8 so needs some tweaking, see my fork https://github.com/aashley/docker-ttrss i've made a stack of changes to how the fpm runs and its all good

@bugwelle
Copy link
Author

@aashley Awesome! Thanks. :)
I'll try it out later.

@bugwelle
Copy link
Author

Checked out your fork, looked at the diffs, and then tried it out. Works (and I have a few hundred unread items) 🎉

@x86dev The proposal by @aashley above works. I'll keep this PR open, as this is also part of the fix.

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

Successfully merging this pull request may close these issues.

None yet

2 participants