Bug 2417003

Summary: Bad time in rsync daemon log
Product: [Fedora] Fedora Reporter: Michal Ruprich <mruprich>
Component: rsyncAssignee: Michal Ruprich <mruprich>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 44CC: luhliari, mruprich, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: rsync-3.4.1-7.fc44 rsync-3.4.1-6.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-05-15 20:57:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Ruprich 2025-11-25 12:24:55 UTC
Running rsync-3.2.3-20.el9_5.1.x86_64

Using the daemon with default provided configuration (/etc/sysconfig/rsyncd)

Configuration (partial)
lock file          = /var/run/rsyncd-mirrors.lock
read only          = true
max connections    = 16
log file           = /var/log/rsyncd/rpms.log
transfer logging   = yes
timeout            = 900
ignore nonreadable = yes
dont compress      = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
refuse options     = checksum
uid                = apache
gid                = apache...
hosts allow =   ... very long list ...

[srpms]
        comment    = Remi's Source RPM (about 10GB)
        path       = /home/rpms/site/SRPMS...

Log sample
2025/01/29 04:00:01 [267227] name lookup failed for 2a0c:8541:200:2010::99: Name or service not known
2025/01/29 04:00:01 [267227] connect from UNKNOWN (2a0c:8541:200:2010::99)
2025/01/29 04:00:01 [267224] connect from mirror.serverion.com (185.28.39.100)
2025/01/29 04:00:01 [267227] rsync allowed access on module enterprise from UNKNOWN (2a0c:8541:200:2010::99)
2025/01/29 03:00:01 [267227] rsync on enterprise//date from UNKNOWN (2a0c:8541:200:2010::99)
2025/01/29 03:00:02 [267227] building file list
2025/01/29 03:00:02 [267227] sent 62 bytes  received 29 bytes  total size 29

I found https://access.redhat.com/solutions/313693

According to https://bugzilla.redhat.com/show_bug.cgi?id=201019 this is a very old issue, which was fixed in RHEL-5

IIRC, RHEL-8 (rsync 3.1) was not affected,
so seems to be a regression in RHEL-9 (rsync 3.2)

Reproducible: Always

Comment 1 Michal Ruprich 2025-11-25 12:25:49 UTC
Found explanation and solution

/etc/localtime is needed to compute localtime.

rsync have code to initialize timezone before chroot, this is even documented (in log_init)

       /* This looks pointless, but it is needed in order for the
         * C library on some systems to fetch the timezone info
         * before the chroot. */
        timestring(time(NULL));

Notice: a tzset call is probably enough here

BUT, localtime do a tzset on each call, so after chroot, this fails

From glibc code (__tz_convert function)

  tzset_internal (tp == &_tmbuf && use_localtime);

Solution is to use the thread safe localtime_r function

Checking using a small (attached) test

# /home/remi/test/tz tzset chroot localtime
TimeZone   : CET/CEST
chroot     : OK
TimeZone   : CET/CEST
localtime  : 2025/01/31 07:39:48
TimeZone   : UTC/UTC

# /home/remi/test/tz tzset chroot localtime_r
TimeZone   : CET/CEST
chroot     : OK
TimeZone   : CET/CEST
localtime_r: 2025/01/31 08:40:04
TimeZone   : CET/CEST

Comment 2 Michal Ruprich 2025-11-25 12:27:43 UTC
Filed as a PR Upstream:
https://github.com/RsyncProject/rsync/pull/730

Comment 3 Fedora Update System 2026-05-13 11:10:00 UTC
FEDORA-2026-d4d8ae2bdc (rsync-3.4.1-6.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-d4d8ae2bdc

Comment 4 Fedora Update System 2026-05-13 11:10:06 UTC
FEDORA-2026-75599531db (rsync-3.4.1-7.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-75599531db

Comment 5 Fedora Update System 2026-05-15 03:27:40 UTC
FEDORA-2026-75599531db has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-75599531db`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-75599531db

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2026-05-15 03:42:24 UTC
FEDORA-2026-d4d8ae2bdc has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-d4d8ae2bdc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-d4d8ae2bdc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2026-05-15 20:57:38 UTC
FEDORA-2026-75599531db (rsync-3.4.1-7.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2026-05-21 01:28:16 UTC
FEDORA-2026-d4d8ae2bdc (rsync-3.4.1-6.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.