Chris Green
2021-Jan-01 09:57 UTC
Is there a default for 'pid file' for rsync in daemon mode?
I just got bitten by a (fairly) subtle problem due to having an
inappropriate location for 'pid file' in my rsyncd.conf.
What I had was:-
pid file = /home/chris/tmp/pid
This works fine until the system running rsync in daemon mode crashes
rather than being properly shut down. The pid file doesn't get
removed and rsync doesn't restart because it thinks it's already
running.
My backup system crashed a couple of nights ago due to a power cut
(can't really blame it!) and I went and restarted it after the power
came back. However, as I note above, files in /home/chris/tmp/pid
aren't cleared out so rsync refused to run when systemd attempted to
start it up.
I guess the pid file should either be in /tmp or somewhere in
/run/user. However shouldn't there be some sort of sensible default
if it isn't set in rsyncd.conf?
--
Chris Green
?
Francis.Montagnac at inria.fr
2021-Jan-01 11:05 UTC
Is there a default for 'pid file' for rsync in daemon mode?
Hi. On Fri, 01 Jan 2021 09:57:38 +0000 Chris Green via rsync wrote:> My backup system crashed a couple of nights ago due to a power cut > (can't really blame it!) and I went and restarted it after the power > came back. However, as I note above, files in /home/chris/tmp/pid > aren't cleared out so rsync refused to run when systemd attempted to > start it up.> I guess the pid file should either be in /tmp or somewhere in > /run/user. However shouldn't there be some sort of sensible default > if it isn't set in rsyncd.conf?Since rsyncd is launched by systemd, I would say that no pid file is needed: systemd will prevent simultaneous launch of rsyncd. Can you try without spicifying "pid file" in rsyncd.conf ? What is the content of the rsyncd.service file on your system ? On Fedora it is a system (not user) service: cat /lib/systemd/system/rsyncd.service [Unit] Description=fast remote file copy program daemon ConditionPathExists=/etc/rsyncd.conf Wants=network-online.target After=network-online.target [Service] EnvironmentFile=/etc/sysconfig/rsyncd ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS" [Install] WantedBy=multi-user.target -- francis