Question: Setting up rsyncd under systemd
I have finally gotten around to writing my first systemd unit definition from scratch. It seems to work, but I wanted to ask the experts here at LQ.org if I have done this correctly. This rsync daemon is hit rarely - once a day in the middle of the night - so I wanted it to be socket activated and exit after completing its task, so as not to consume resources when it's not in use. The startup time is of no importance in this application.
Here's what I have: Newly created file: /etc/systemd/system/sockets.target.wants/rsyncd.socket Code:
[Unit] /etc/systemd/system/rsyncd@.service Code:
[Unit] systemctl start rsyncd.socket systemctl status rsyncd.socket Code:
● rsyncd.socket - RSYNC Socket for Per-Connection Servers netstat -anp | grep LISTEN | grep 873 Code:
tcp6 0 0 :::873 :::* LISTEN 1/init Code:
root 498 32719 0 12:27 pts/1 00:00:00 grep --color=auto rsync I ran a rsync client from a different computer and it connected and displayed the files I asked for just fine (client command was "rsync -rtd ...") Everything seems good as best I can tell. systemctl enable rsyncd@.service No output from this command, but exit value was zero (successful). Have I done everything correctly above? Or do I have some dastardly misconfiguration somewhere that will come back to bite me later? I googled a bit to come up with the above solution, and it appears to work just like I had hoped, but I wanted to ask the experts here for comments/suggestions/advice since this is my first attempt at systemd. I've been one of the old generation holdouts, using older technologies, finally dragging myself into the future now. Thanks in advance for any tips. |
First of all, rsyncd has the tiniest footprint. You aren't really saving resources. Second, see this for one of the status messages you received, and some links to systemd stuff in general: https://askubuntu.com/questions/8360...s-includes-bad
Try taking the '@' out of the systemctl command. |
Quote:
|
All times are GMT -5. The time now is 02:57 PM. |