rsync: remove pid file if it already exists
authorJo-Philipp Wich <jo@mein.io>
Thu, 18 Jul 2019 12:56:47 +0000 (14:56 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 18 Jul 2019 12:56:47 +0000 (14:56 +0200)
If the rsync container was forcibly shut down, it may still contain
a stale pid file entry.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
docker/rsync/files/entry.sh

index 9512a4a7a550051b576a300e6ad222757d17c3a9..587602e9736bdd4bb22ff2b15841e867af9d54b7 100644 (file)
@@ -24,4 +24,6 @@ fi
 
 chown "${SHARE_UID:-1000}:${SHARE_GID:-1000}" /data
 
+rm -f /tmp/rsyncd.pid
+
 exec /usr/bin/rsync --daemon --no-detach --config=/rsyncd.conf --log-file=/dev/stdout --dparam=pidfile=/tmp/rsyncd.pid "$@"