CS01-HS Posted May 3, 2021 Posted May 3, 2021 I run the official Emby container with the following Post Arguments to call a custom script which prunes the transcoding directory: && docker exec EmbyServer sh -c 'watch -n30 "/system-share/transcoding-temp-fix.sh" > /transcode/transcoding-temp-fix.log &' The problem is it doesn't run on restart. However, if I edit the container and click Apply it runs every time. Am I doing something obviously wrong and if not how should I go about debugging it? I don't see anything suspicious in the container or unraid's system log. Quote
primeval_god Posted May 4, 2021 Posted May 4, 2021 I am fairly certain that is not how the Post Arguments field is meant to be used. Its purpose is to add extra arguments to the end of the Docker run command, not append a completely new docker command. The problem you are facing stems from the fact that the Post Arguments become part of the docker run command, and thus only executes when the container is recreated not when it starts or stops. Unfortunately i am not really certain how to achieve what you are trying to do aside from forking the official Emby container and integrating your script. 1 Quote
CS01-HS Posted May 4, 2021 Author Posted May 4, 2021 Well that explains that. If there's no reliable way to do it with the template (I don't really know docker or unraid's specific implementation) I guess I could cron a user script that calls it with docker exec, but it would have to be more complex to guard against multiple instances. Thanks. Quote
primeval_god Posted May 5, 2021 Posted May 5, 2021 It looks like the emby/embyserver container may be based on a base image with an s6-overlay. If that is the case you could potentially put your script launch command watch -n30 "/system-share/transcoding-temp-fix.sh" > /transcode/transcoding-temp-fix.log & into a launch script and bind mount that into the container under the /etc/cont-init.d directory. If i understand s6 correctly it would run your script when the container starts. https://github.com/just-containers/s6-overlay#init-stages 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.