linuxserver / docker-jackett

GNU General Public License v3.0
394 stars 95 forks source link

Taking a long time for docker to start. #48

Closed galacticat closed 6 years ago

galacticat commented 6 years ago

linuxserver.io

I recently restarted my host and noticed the only thing that didn't come back up was the Jackett instance in docker. I removed it and recreated it and it took 30 minutes to an hour to start on a fresh install of the docker instance.

Ubuntu 16.04

sudo docker run -d --restart always -h jackett --name jackett -v /config:/config -v /media/Downloads:/downloads -e PGID=1001 -e PUID=111 -e TZ=America/Chicago -p 9117:9117 linuxserver/jackett:latest

[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/
-------------------------------------
GID/UID
-------------------------------------

User uid:    111
User gid:    1001
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...

Thanks, team linuxserver.io

thelamer commented 6 years ago

The process is hanging on the following logic:

chown -R abc:abc \
    /app \
    /config \
        /downloads

This ensures the files in the mounted volume are owned by the 1001:111 user in your case.

It would only hang if you have millions of files in there or a very low IO disk.

Technically this could be a run once scenario with a lock file, I just am not sure if this is a widespread thing or only applies to your use case.

To get around it for now you can run this on the container (keeping in mind updates would null the change out)

sudo docker exec -it <your-container-name> sh -c 'echo "exit 0" > /etc/cont-init.d/30-config'

It will not run the chown on boot.

galacticat commented 6 years ago

Originally I was mapping my full downloads directory to /downloads in the container (which contained pretty much everything I've ever downloaded). I changed that to only map my empty black hole directory to /downloads. It is restarting in a reasonable time now, thanks!