Daemon won't start at boot up (18LTS fully patched)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rsync |
Unknown
|
Unknown
|
|||
rsync (Ubuntu) |
Won't Fix
|
Low
|
Unassigned |
Bug Description
By adding the 'address=' option to the /etc/rsyncd.conf file, the daemon fails at boot.
Once the NIC(s) is/are up, it will start fine when executed via systemctl start rsync
● rsync.service - fast remote file copy program daemon
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Sat 2018-06-02 08:01:31 CST; 52min ago
Process: 851 ExecStart=
Main PID: 851 (code=exited, status=10)
Jun 02 08:01:31 billlaptop.
Jun 02 08:01:31 billlaptop.
Jun 02 08:01:31 billlaptop.
Jun 02 08:01:31 billlaptop.
Jun 02 08:01:31 billlaptop.
Jun 02 08:01:31 billlaptop.
Jun 02 08:01:31 billlaptop.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: rsync 3.1.2-2.1ubuntu1
ProcVersionSign
Uname: Linux 4.15.0-22-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.1
Architecture: amd64
CurrentDesktop: GNOME
Date: Sat Jun 2 08:48:15 2018
InstallationDate: Installed on 2018-06-01 (0 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: rsync
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in rsync (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
tags: | added: network-online-ordering |
Thanks for filing this bug in Ubuntu.
The scenario is confirmed: when specifying an address to bind to, rsync will fail if that address is not available: rsync-1774788 rsyncd[269]: rsyncd version 3.1.2 starting, listening on port 873 rsync-1774788 rsyncd[269]: bind() failed: Cannot assign requested address (address-family 2) rsync-1774788 rsyncd[269]: unable to bind any inbound sockets on port 873 rsync-1774788 rsyncd[269]: rsync error: error in socket IO (code 10) at socket.c(555) [Receiver=3.1.2]
/var/log/syslog:Jun 4 21:12:27 bionic-
/var/log/syslog:Jun 4 21:12:27 bionic-
/var/log/syslog:Jun 4 21:12:27 bionic-
/var/log/syslog:Jun 4 21:12:27 bionic-
The solution seems to be for rsync to adopt the socket option IP_FREEBIND.
From the ip(7) manpage:
IP_FREEBIND (since Linux 2.4)
If enabled, this boolean option allows binding to an IP
address that is nonlocal or does not (yet) exist. This per‐
mits listening on a socket, without requiring the underlying
network interface or the specified dynamic IP address to be up
at the time that the application is trying to bind to it.
This option is the per-socket equivalent of the ip_nonlo‐
cal_bind /proc interface described below.
Until then, one workaround would be to configure the service file for rsyncd to wait for the network to be online.
If you run:
sudo systemctl edit rsync.service
It will open an editor. Put these lines in: target, network- online. target
[Unit]
After=network.
Then save. That will create /etc/systemd/ system/ rsync.service. d/override. conf with the two lines above. Alternatively you can just create the file above directly with the specified content without going through "systemctl edit".
You can then reboot and see if that helps. Note that the job will fail, after reaching the network-online target, if you specify an IP address that doesn't exist at that stage.
Another option I saw in https:/ /unix.stackexch ange.com/ questions/ 442181/ sshd-failed- due-to- network- not-yet- available but haven't tested is to make a system-wide change in /proc.