diff --git a/daemon/entrypoint.sh b/daemon/entrypoint.sh
index 7b502660cb98ee481a11f45ce26f47355c6724df..c5576f0918689b95751aff17959d7f83e018d382 100755
--- a/daemon/entrypoint.sh
+++ b/daemon/entrypoint.sh
@@ -1,9 +1,9 @@
 #!/bin/sh
 set -eu
 
-rm /tmp/rtorrent.log
-touch /tmp/rtorrent.log
-rm /tmp/.session/rtorrent.lock /tmp/.session/rtorrent.pid
+mkdir -p /tmp/.session
+echo > /tmp/rtorrent.log
+rm /tmp/.session/rtorrent.lock /tmp/.session/rtorrent.pid || true
 
 # Start rtorrent as a daemon with the setting in the config file
 # & to actually run it in the background