2

I have CentOS 7 and it comes with Rsync 3.0.9. I downloaded the 3.1.1 el7 rpm and installed with rpm -Uvh.

Now the daemon refuse to start. I tried to create :

/usr/lib/systemd/system/rsyncd.service

[Unit]
Description=A program for synchronizing files over a network
After=syslog.target network.target
ConditionPathExists=/etc/rsyncd.conf

[Service]
EnvironmentFile=-/etc/sysconfig/rsyncd
ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS"

[Install]
WantedBy=multi-user.target

No luck :

/bin/systemctl status  rsyncd.service
● rsyncd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: failed (Result: exit-code) since Thu 2016-04-21 15:27:00 EDT; 56min ago
 Main PID: 1452 (code=exited, status=20)

Note those referenced file in the configuration exist:

-rw-r--r-- 1 root root 1699 Feb  4 14:27 /etc/rsyncd.conf
-rw-r--r-- 1 root root 11 Apr 21 16:09 /etc/sysconfig/rsyncd
5
  • What 3.1.1 el7 rpm? Apr 21, 2016 at 20:27
  • I'd go back using 3.0.9, unless you're REALLY need something from 3.1.1, it looks like rpm that you're using is packaged differently from the one that ships with distributive.
    – alexus
    Apr 21, 2016 at 20:29
  • rsync-3.1.1-1.el7.rfx.x86_64.rpm, I need the new --chown option.
    – Bastien974
    Apr 21, 2016 at 20:31
  • @Bastien974 can't --owner be use instead?
    – alexus
    Apr 21, 2016 at 20:32
  • @Alexus, I need the owner to be different on the destination. (note that -o is required for --chown to work)
    – Bastien974
    Apr 21, 2016 at 20:35

2 Answers 2

3

I've got 3.1.1 under fedora 22.

The requisite config files for rsyncd are in the rsync-daemon package. I've listed the files in each package below.

I'd just install the extra package.

But, I did notice a typo in your config file ...

Change:

EnvironmentFile=-/etc/sysconfig/rsyncd

Into:

EnvironmentFile=/etc/sysconfig/rsyncd

Here's a list of files in the rsync package:

/usr/bin/rsync
/usr/share/doc/rsync
/usr/share/doc/rsync/NEWS
/usr/share/doc/rsync/OLDNEWS
/usr/share/doc/rsync/README
/usr/share/doc/rsync/support
/usr/share/doc/rsync/support/Makefile
/usr/share/doc/rsync/support/atomic-rsync
/usr/share/doc/rsync/support/cvs2includes
/usr/share/doc/rsync/support/deny-rsync
/usr/share/doc/rsync/support/file-attr-restore
/usr/share/doc/rsync/support/files-to-excludes
/usr/share/doc/rsync/support/git-set-file-times
/usr/share/doc/rsync/support/instant-rsyncd
/usr/share/doc/rsync/support/logfilter
/usr/share/doc/rsync/support/lsh
/usr/share/doc/rsync/support/lsh.sh
/usr/share/doc/rsync/support/mapfrom
/usr/share/doc/rsync/support/mapto
/usr/share/doc/rsync/support/mnt-excl
/usr/share/doc/rsync/support/munge-symlinks
/usr/share/doc/rsync/support/rrsync
/usr/share/doc/rsync/support/rsync-no-vanished
/usr/share/doc/rsync/support/rsync-slash-strip
/usr/share/doc/rsync/support/rsyncstats
/usr/share/doc/rsync/support/savetransfer.c
/usr/share/doc/rsync/tech_report.tex
/usr/share/licenses/rsync
/usr/share/licenses/rsync/COPYING
/usr/share/man/man1/rsync.1.gz

Here's a list of files in the rsync-daemon package:

/etc/rsyncd.conf
/etc/sysconfig/rsyncd
/usr/lib/systemd/system/rsyncd.service
/usr/lib/systemd/system/rsyncd.socket
/usr/lib/systemd/system/rsyncd@.service
/usr/share/man/man5/rsyncd.conf.5.gz

UPDATE:

I tried to force install rsync-daemon on my Centos 7, given that it's just text file, I took a chance and ignored the dependency.

I'm not sure what dependency you mean, but I looked at the rpm's .spec file and it lists systemd-units, but I can't find an rpm for that.

No luck.

Not quite sure what this means. Did the files extract/install or not? Can you do ls -l on them? As a last resort, did you try rpm --nodeps --force?

Given an .rpm file, it is possible to manually extract files using rpm2cpio [should be part of the already installed rpm package] and either cpio or pax [which is very similar to tar, but understands both tar and cpio format archives].

I've usually had better luck using pax. It has its own rpm [to install: yum install pax]. In fact, I've never gotten the rpm2cpio/cpio combination to work correctly for extraction.

To list an rpm file using pax:

rpm2cpio rpmfile | pax -v

To extract an rpm file using pax:

rpm2cpio rpmfile | pax -v -r

I also tried to extract the file directly, but it still refuses to start.

You may have to consult some logfiles, such as /var/log/messages, /var/log/audit/audit.log, /var/log/secure, and may have to use the journalctl program to view the systemd log.

You might have some [silly] selinux security restriction that has to be fixed. You may have to run restorecon on the config files.

Also, you may have to add something to the /etc files as it may be rsync itself that doesn't want to start (vs. systemd not starting rsync).

Below are the contents of the rsync-daemon files, except for the man page file [which is way too large to include here]. The man page file can be found here: http://linux.die.net/man/5/rsyncd.conf


/etc/rsyncd.conf

# /etc/rsyncd: configuration file for rsync daemon mode

# See rsyncd.conf man page for more options.

# configuration example:

# uid = nobody
# gid = nobody
# use chroot = yes
# max connections = 4
# pid file = /var/run/rsyncd.pid
# exclude = lost+found/
# transfer logging = yes
# timeout = 900
# ignore nonreadable = yes
# dont compress   = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2

# [ftp]
#        path = /home/ftp
#        comment = ftp export area

/etc/sysconfig/rsyncd

OPTIONS=""

/usr/lib/systemd/system/rsyncd.service

[Unit]
Description=fast remote file copy program daemon
ConditionPathExists=/etc/rsyncd.conf

[Service]
EnvironmentFile=/etc/sysconfig/rsyncd
ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS"

[Install]
WantedBy=multi-user.target

/usr/lib/systemd/system/rsyncd@.service

[Unit]
Description=fast remote file copy program daemon
ConditionPathExists=/etc/rsyncd.conf

[Service]
EnvironmentFile=/etc/sysconfig/rsyncd
ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS"
StandardInput=socket

/usr/lib/systemd/system/rsyncd.socket

[Unit]
Description=Rsync Server Socket
Conflicts=rsyncd.service

[Socket]
ListenStream=873
Accept=yes

[Install]
WantedBy=sockets.target
7
  • Why do you suggest changing EnvironmentFile=? It looks correct as it was. Apr 21, 2016 at 21:08
  • @MichaelHampton I extracted the file from the rpm and it didn't match OP's. But, my first advice was to install the rsync-daemon package which has other files as well. (i.e.) The error message didn't say which file was missing. After that, OP can start tweaking if things still don't work. Apr 21, 2016 at 21:18
  • @CraigEstey, where do I get rsync-daemon ?
    – Bastien974
    Apr 25, 2016 at 14:21
  • Normally, it's part of your distro, so yum install rsync-daemon should work. Also, you can find RPMs for the rsync-daemon here: rpmfind.net/linux/rpm2html/search.php?query=rsync-daemon These contain mostly text/config files so not much variance. These will need a manual install with either yum [newer is dnf] or rpm. Try one until you find the best match for your system. Apr 26, 2016 at 3:55
  • I tried to force install rsync-daemon on my Centos 7, given that it's just text file, I took a chance and ignored the dependency. No luck. I also tried to extract the file directly, but it still refuses to start.
    – Bastien974
    Apr 29, 2016 at 13:18
2

I found out that systemctl daemon-reload is required to load the service. After doing that, it worked right away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.