Post Arguments works inconsistently


CS01-HS

4 posts in this topic Last Reply

Recommended Posts

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.

Link to post

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.

Link to post

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.

Link to post

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

Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.