From e668903b304410b45de0e7f4ad245258f805c8a1 Mon Sep 17 00:00:00 2001 From: John Doe Date: Thu, 14 Mar 2019 09:39:05 +0100 Subject: [PATCH] Disable lock file --- README.md | 2 +- config.d/00-main.rc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bcf8806..54b11d1 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ If it's not your intention to control rTorrent from a third-party application, d There is a volume which maps the directory that rTorrent uses to store session data. This is useful for a couple of reasons. -*First*, when the container is badly stopped and the daemon does not have time to remove its [lock file](https://en.wikipedia.org/wiki/File_locking), you can easily access it from the host system and delete it by yourself. +~~*First*, when the container is badly stopped and the daemon does not have time to remove its [lock file](https://en.wikipedia.org/wiki/File_locking), you can easily access it from the host system and delete it by yourself.~~ Lock file has been disabled from [this commit](https://github.com/StayPirate/alpine-rtorrent/commit/WAITING_FOR_COMMIT_ID), the container can now be automatically restarted. *Second*, all the information about the downloading torrents will be preserved. Don't forget that it is not a named volume, you need to know the hash of the volume created by your container and you can get it with ```docker container inspect --format '{{ .Mounts }}' rtorrent```. If you prefer, a named volume can be passed by command line which overrides the one in the Dockerfile. It will ensure the operation of switching containers easier. To do it, you need to pass ```-v rtorrent_session:/home/rtorrent/rtorrent/.session``` at container creation time. ## Bind Mounts diff --git a/config.d/00-main.rc b/config.d/00-main.rc index 03a1676..18b73a4 100644 --- a/config.d/00-main.rc +++ b/config.d/00-main.rc @@ -16,6 +16,10 @@ execute.throw = sh, -c, (cat,\ "mkdir -p \"",(cfg.watch),"/load\" ",\ "\"",(cfg.watch),"/start\" ") +## There is no point in using lock file in a docker container since it will only +## give you major headaches if the process dies unexpectedly. +## Moreover, be sure to not use the same session volume with more than one container. +session.use_lock.set = no ## Listening port for incoming peer traffic (fixed; you can also randomize it) network.port_range.set = 50000-50000