mondediefr/docker-rutorrent

php-fpm does not start in the docker

Closed this issue · 6 comments

I'm unable to start phpfpm7 inside the docker. Unfortunately it doesn't really say why :(

# docker run --name rutorrent --rm -it -e UID=0 -e GID=0 -v /share/Torrent/config:/config -v /share/Torrent/data:/data mondedie/rutorrent:latest /bin/sh
Unable to find image 'mondedie/rutorrent:latest' locally
latest: Pulling from mondedie/rutorrent
c9b1b535fdd9: Already exists
eb4f6dbadfc5: Pull complete
4d85206ec698: Pull complete
27e7a3860fb7: Pull complete
0724d55fb22c: Pull complete
4f83d6832e74: Pull complete
1f592742d787: Pull complete
Digest: sha256:e9ad3b4b7b42212415252e9db8059418f99cd83c72996c1ca29f350022302797
Status: Downloaded newer image for mondedie/rutorrent:latest
[2020/03/28-15:29:48] Create user torrent ...
[2020/03/28-15:29:48] Create user torrent done
[2020/03/28-15:29:48] Generate configuration ...
[2020/03/28-15:29:48] Generate configuration done
[2020/03/28-15:29:48] HTTP authentication configuration ...
[2020/03/28-15:29:48] HTTP authentication configuration done
[2020/03/28-15:29:48] Update old configurations ...
[2020/03/28-15:29:48] Update old configurations done
[2020/03/28-15:29:48] Apply system permissions ...
[2020/03/28-15:29:49] Apply system permissions done
[2020/03/28-15:29:49] Apply data permissions ...
[2020/03/28-15:29:49] Apply data permissions done
[2020/03/28-15:29:49] Start all services ...

/ # /usr/sbin/php-fpm7
[28-Mar-2020 15:30:55] ALERT: [pool www] user has not been defined
[28-Mar-2020 15:30:55] ERROR: failed to post process the configuration
[28-Mar-2020 15:30:55] ERROR: FPM initialization failed

/ # echo $?
78

I'm trying to execute this on a QNAP station:

# cat /etc/os-release
NAME="QTS"
VERSION="4.4.1 (20200214)"
ID=qts
PRETTY_NAME="QTS 4.4.1 (20200214)"
VERSION_ID="4.4.1"

It has an intel processor
Intel(R) Celeron(R) CPU J3455 @ 1.50GHz

Any ideas (beside googeling) i could do to find out the problem?

Don't run the container interactively and with the sh shell, you break CMD configuration.

docker run --name rutorrent -dt --rm \
  -e UID=0 \
  -e GID=0 \
  -p 8080:8080 \
  -p 45000:45000 \
  -v /share/Torrent/config:/config \
  -v /share/Torrent/data:/data \
  mondedie/rutorrent:latest

If you want test something on the container.

docker exec -it rutorrent sh

Well, that would only work if the container would keep running. But it does not:

# docker run -e UID=0 -e GID=0 -v /share/Torrent/config:/config -v /share/Torrent/data:/data mondedie/rutorrent:latest
[2020/03/28-17:45:59] Create user torrent ...
[2020/03/28-17:45:59] Create user torrent done
[2020/03/28-17:45:59] Generate configuration ...
[2020/03/28-17:45:59] Generate configuration done
[2020/03/28-17:45:59] HTTP authentication configuration ...
[2020/03/28-17:45:59] HTTP authentication configuration done
[2020/03/28-17:45:59] Update old configurations ...
[2020/03/28-17:46:00] Update old configurations done
[2020/03/28-17:46:00] Apply system permissions ...
[2020/03/28-17:46:00] Apply system permissions done
[2020/03/28-17:46:00] Apply data permissions ...
[2020/03/28-17:46:00] Apply data permissions done
[2020/03/28-17:46:00] Start all services ...
[28-Mar-2020 17:46:01] ALERT: [pool www] user has not been defined
[28-Mar-2020 17:46:01] ERROR: failed to post process the configuration
[28-Mar-2020 17:46:01] ERROR: FPM initialization failed
Error opening terminal: unknown.
stop s6

Adding -t makes the terminal error go away, but the fpm error persists.

Ok you can't use root user (uid=0) because startup script can't add the torrent user.

https://github.com/mondediefr/docker-rutorrent/blob/master/rootfs/usr/local/bin/startup#L30-L39

Indeed. Using UID/GID other than 0 fixes it. Thank you.
Idea: Script should break/stop when things like this happens. If it's important that it needs to create the torrent user than it should make sure it is created.
Thanks again!

@MichaelKunze indeed i just commit this 26ea679