Backport upstream bugfix "$PreserveFQDN on" not working properly

Bug #1022545 reported by stchesmeli
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
rsyslog (Ubuntu)
Fix Released
Undecided
Louis Bouchard
Precise
Fix Released
Undecided
Louis Bouchard
Quantal
Won't Fix
Undecided
Louis Bouchard
Raring
Fix Released
Undecided
Louis Bouchard

Bug Description

SRU justification :

The $PreserveFQDN functionality does not work as expected. Even when defining it as 'on', the fully qualified domain name is not reported by rsyslog

Impact :

Unable to have the FQDN added to the hostname in syslog

Fix :

Upstream fix committed to upcoming 7.4 version of rsyslog :

http://git.adiscon.com/?p=rsyslog.git;a=commitdiff_plain;h=89ace1e401dc179a20ec283c2f7c2f80becf4700

Test Case :

1. Configure rsyslog on a system that has the hostname defined with fully
   qualified domain name in /etc/hosts :

192.168.122.10 rsyslogserver.localdomain.com rsyslogserver

The hostname -f command should return the hostname with FQDN appended :

$ hostname -f
rsyslogserver.localdomain.com

2. Add the following entry in /etc/rsyslog.conf

$PreserveFQDN on

3. Restart rsyslogd :

$ restart rsyslog

4. Verify in /var/log/syslog that hostname + fqdn appears :

Apr 25 14:13:29 rsyslogserver.localdomain.com kernel: imklog 5.8.6, log source = /proc/kmsg started.

With the current version of rsyslog, only the hostname appears

Regression :

Minimal risk as the value defined by the patch is only used if the $PreserveFQDN variable is defined in /etc/rsyslog.conf, which is absent by default.

Description of the problem :

When adding $PreserveFQDN on in /etc/rsyslog.conf to have the Fully Qualified Domain Name appended to the hostname reported by rsyslog, the functionality does not work and only the hostname is reported.

Original description (which is wrong as the cited commit does not fix the problem)

You will find patch and information here:

http://git.adiscon.com/?p=rsyslog.git;a=commitdiff;h=dec9bcfe2a869b0f70b5f2a18e08a0322ebf5517

Please backport this patch for precise.

Revision history for this message
Louis Bouchard (louis) wrote :

This patch does not seem to fix the PreserveFQDN functionality as expected.

A new bug for this issue with a proposed patch has been submitted upstream :

http://bugzilla.adiscon.com/show_bug.cgi?id=426

I'm waiting to hear from the maintainer

Changed in rsyslog (Ubuntu):
status: New → Confirmed
assignee: nobody → Louis Bouchard (louis-bouchard)
Louis Bouchard (louis)
Changed in rsyslog (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Louis Bouchard (louis) wrote :

Upstream accepted proposed patch :

Rainer Gerhards 2013-04-17 09:04:35 CEST
Thanks for ASL 2.0. I have finally analysed the situation myself in depth and agree to your analysis. Looking at the code, it looks like I actually forgot what you added in the patch, it's definitely the right path to take.

I have now merged. Will be released as part of 7.3.11.

Since 5.8.11*is no longer supported, I will work at adapting the patch to the 5.8.11* version and SRU the modification once accepted in the development branch

summary: - Backport upstream bugfix "$PreserveFQDN on" was not honored in some
- modules
+ Backport upstream bugfix "$PreserveFQDN on" not working properly
Louis Bouchard (louis)
Changed in rsyslog (Ubuntu Precise):
status: New → Confirmed
Changed in rsyslog (Ubuntu Quantal):
status: New → Confirmed
Changed in rsyslog (Ubuntu Precise):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in rsyslog (Ubuntu Quantal):
assignee: nobody → Louis Bouchard (louis-bouchard)
Revision history for this message
Louis Bouchard (louis) wrote :

tested debdiff including the patch for Precise

description: updated
Changed in rsyslog (Ubuntu Quantal):
status: Confirmed → In Progress
Changed in rsyslog (Ubuntu Precise):
status: Confirmed → In Progress
Revision history for this message
Louis Bouchard (louis) wrote :

tested debdiff including the patch for Quantal

Revision history for this message
Louis Bouchard (louis) wrote :

tested debdiff including the patch for Raring

Chris J Arges (arges)
tags: added: cts-client-review
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Louis, do you really need the fix backported on all those series? The SRU team is having an hard time keep up with updates and we try to lower the efforts spent on e.g quantal which is neither current_stable nor a LTS...

Revision history for this message
Sebastien Bacher (seb128) wrote :

uploaded to raring, saucy and precise (after rebasing on the current version there), I'm skipping quantal and unsubscribing sponsors, please subscribe them back if you really want the SRU in that serie

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rsyslog - 5.8.11-2ubuntu3

---------------
rsyslog (5.8.11-2ubuntu3) saucy; urgency=low

  * Fixes LP: #1022545 : $PreserveFQDN is not working properly
    - Backport upstream fix
 -- Louis Bouchard <email address hidden> Thu, 25 Apr 2013 12:40:26 +0200

Changed in rsyslog (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Louis Bouchard (louis) wrote :

Hi Seb128,

As discussed on IRC, exlucing Q is fine. We'll respin if required. A workaround could be to use the package from Raring on Q which would suffice anyway.

Thanks for the uploads

Revision history for this message
Dave Walker (davewalker) wrote :

Marking Quantal WON'T FIX, as stated from previous comments

Changed in rsyslog (Ubuntu Quantal):
status: In Progress → Won't Fix
Revision history for this message
Dave Walker (davewalker) wrote :

This is currently blocked from processing via an inflight SRU, bug 1169740, https://launchpad.net/ubuntu/+source/rsyslog/5.8.6-1ubuntu8.2

Thanks.

Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello stchesmeli, or anyone else affected,

Accepted rsyslog into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/rsyslog/5.8.6-1ubuntu8.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in rsyslog (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in rsyslog (Ubuntu Raring):
status: In Progress → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello stchesmeli, or anyone else affected,

Accepted rsyslog into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/rsyslog/5.8.11-2ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Simon Déziel (sdeziel) wrote :

The -proposed package fixes the issue on both Precise and Raring. Thanks

tags: added: verification-done
removed: verification-needed
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rsyslog - 5.8.6-1ubuntu8.3

---------------
rsyslog (5.8.6-1ubuntu8.3) precise; urgency=low

  * Fixes LP: #1022545 : $PreserveFQDN is not working properly
    - Backport upstream fix
 -- Louis Bouchard <email address hidden> Thu, 25 Apr 2013 11:57:36 +0200

Changed in rsyslog (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rsyslog - 5.8.11-2ubuntu2.1

---------------
rsyslog (5.8.11-2ubuntu2.1) raring; urgency=low

  * Fixes LP: #1022545 : $PreserveFQDN is not working properly
    - Backport upstream fix
 -- Louis Bouchard <email address hidden> Thu, 25 Apr 2013 12:40:26 +0200

Changed in rsyslog (Ubuntu Raring):
status: Fix Committed → Fix Released
Revision history for this message
Christoph Ziebuhr (cziebuhr) wrote :

The original patch has a bug which leads to "malloc(): memory corruption". A fix can be found at http://git.adiscon.com/?p=rsyslog.git;a=commitdiff_plain;h=9c54bf41d02ba236137859ea5f12d6f048647349
The fix is critical because rsyslog won't start anymore.

Revision history for this message
Louis Bouchard (louis) wrote :

@cziebuhr:

Sorry, I wasn't aware that Rainer had added a correction to my patch. And all of my tests including regresssions never outlined such a behavior.

I have just opened a new bug to get that fixed : LP: #1187808

Please subscribe to this bug to stay updated on its evolution.

Revision history for this message
Simon Déziel (sdeziel) wrote :

Christoph, I have deployed the updated Precise version on many machines (all amd64) and had no startup problem with or without $PreserveFQDN. That said, the test case provided (restarting rsyslog and checking for FQDN) isn't enough as other log entries are missing the FQDN.

Revision history for this message
Christoph Ziebuhr (cziebuhr) wrote :

The test case is not checking for FQDN (i don't use $PreserveFQDN). The upgrade to 5.8.6-1ubuntu8.3 was stuck because the restart triggered from postinst did never return.

Revision history for this message
Steve Langasek (vorlon) wrote :

> Minimal risk as the value defined by the patch is only used
> if the $PreserveFQDN variable is defined in /etc/rsyslog.conf,
> which is absent by default.

It turns out this is not the case. There is a critical regression in rsyslog as a result of this patch; the value may not be *used* without $PreserveFQDN, but the code to *set* it is still executed, and there's an off-by-one error in the patch causing malloc corruption (bug #1187876).

Revision history for this message
Lars Hansson (romabysen) wrote :

It seems this is still not fixed. I have rsyslog 5.8.11-2ubuntu2.2 running on 13.04 and the full hostname (using either $PreserveFQDN or $LocalHostName) is only used for messages from rsyslog itself. Messages from sshd, sudo, pam etc etc are only using the bare hostname.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.