We have moved to a new Sailfish OS Forum. Please start new discussions there.

rsync daemon mode as a systemd socket listener

asked 2014-01-25 01:46:14 +0300

gcobb gravatar image

Does anyone have a suitable systemd .socket file to run rsync as root in daemon mode when a connection is made?

I realise I can use rsync over ssh but I would like to run rsync as root so I can use it to backup important system directories as well as /home/nemo. The way I have all my other devices set up is to run rsync as daemon from inetd but on sailfish the preferred option seems to be to use a systemd .socket definition.

If no one has one, I will look at the systemd documentation and create one. But I thought someone might have already set this up.

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted

answered 2014-01-27 22:28:11 +0300

gcobb gravatar image

updated 2014-01-27 22:31:33 +0300

I have created the required files myself, and they seem to work. All the instructions below should be run as root...

Create /etc/systemd/system/rsyncd.socket:

Description=Rsync Server Activation Socket



Create /etc/systemd/system/rsyncd@.service:

Description=Rsync Server

# Note: this requires /etc/rsyncd.conf
ExecStart=/usr/bin/rsync --daemon

Before you can use these, you need to also create /etc/rsyncd.conf. That is an exercise for the reader.

You can start rsyncd when you need it using:

systemctl start rsyncd.socket

Test that it has started correctly using:

rsync localhost::

It would be nice if these systemctl files could be added to the rsync package.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2014-01-25 01:46:14 +0300

Seen: 3,170 times

Last updated: Jan 27 '14