Closed oscar-b closed 4 years ago
I've definitely run into this issue before myself, however, I'm not sure how to fix this. As far as I know Docker doesn't have a way to run a command before (or after) starting/restarting a container.
The only way I can think of to do this would be to change the CMD
line in the Dockerfile to something like:
CMD ["rm", "-f", "/etc/flexget/.config-lock && flexget", "&&", "flexget", "-c", "/etc/flexget/config.yml", "--loglevel", "verbose", "daemon", "start"]
However, this would totally break the single process nature of Docker and I'm not even sure that would work. If you have any other ideas please share.
In the event this does happen to you though you can solve it like so (assuming you followed the README and named your containers/volumes the same):
docker stop flexget-client
.config-lock
file from the volumedocker run -it --rm -v flexget-data:/etc/flexget phlak/flexget phlak/flexget rm /etc/flexget/.config-lock
docker start flexget-client
Using a bash script which deletes the file before launching Flexget doesn’t break single process of Docker since it won’t run simultaneously, and I think this is a totally fine way of solving it. Would be better with an option in Flexget itself though, but that might be more of a hassle to implement.
@PHLAK Seen that Flexget themselves recommend removing the lock file on start? https://flexget.com/InstallWizard/SynologyNAS/Docker
Good to know @oscar-b, also leaving this here as a note for myself: https://stackoverflow.com/a/41518225
Hi
When the Flexget crashes, it can't start again due to the
.config-lock
file being left. Would it be possible to add a way to automatically remove this file when re-starting?