Hey everyone! I'm having trouble with my Jellyfin container not starting on boot. I have this network mount for my videos that's supposed to bind to the container, but it seems like the container doesn't wait for the network share to be available before trying to start up. When I manually start the container, everything works perfectly, but it just won't start automatically at boot. If I remove the mount, it starts without a hitch, but then I obviously lose access to my media. Is there a surefire way to make the container wait for the network share to finish mounting before it starts? Any suggestions would be super helpful!
5 Answers
Just make your Docker service depend on the mount.service by using 'After=' and 'Requires=' options in your service configuration for Docker if you're using a network mount. This way, Docker waits for the mount to be ready.
You could use Quadlets to set systemd dependencies for your container. This can help in ensuring that your network mount is available before starting up Jellyfin.
You might want to check the startup order of processes on your system. If you're using systemd, you can ensure that networking and mounts are up and running before your Jellyfin instance starts. Another option is to create a wrapper script that waits for the mount to be available before launching the container. If you could share your system details and how you're automating the media mount, I or someone else can give you a more specific solution!
One easy fix is to mount your network share to a local folder using fstab first, and then modify your Jellyfin volume bind to point to that local folder instead. This way, Jellyfin starts with the media already mounted.
I set up SMB mounts in my Docker Compose with a restart policy of 'always' or 'unless-stopped'. This way, if the mount target is unavailable, the container fails to start but keeps trying until it can.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures