May 3, 20215 yr 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.
May 4, 20215 yr Community Expert 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.
May 4, 20215 yr Author 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.
May 5, 20215 yr Community Expert 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
Archived
This topic is now archived and is closed to further replies.