samba logs are not being reported in logwatch

Bug #1010602 reported by Jacob Smith
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
logwatch
Unknown
Unknown
logwatch (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Fix Released
Medium
Unassigned

Bug Description

After upgrading from 10.04 to 12.04 samba logs no longer show up in logwatch reports.

There was a change to /usr/share/logwatch/default.conf/logfiles/samba.conf between 10.04 and 12.04:
   LogFile=samba/* was changed to LogFile=samba/*.log

In the samba package the default smb.conf file has logging defined as (no change 10.04-12.04):
   log file = /var/log/samba/log.%m

Since files are log.* they are no longer parsed by logwatch because logwatch only looks for *.log

1. Description: Ubuntu 12.04 LTS
Release: 12.04

2. logwatch:
  Installed: 7.4.0+svn20111221rev79-1ubuntu1
  Candidate: 7.4.0+svn20111221rev79-1ubuntu1
  Version table:
 *** 7.4.0+svn20111221rev79-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

samba:
  Installed: 2:3.6.3-2ubuntu2.1
  Candidate: 2:3.6.3-2ubuntu2.2
  Version table:
     2:3.6.3-2ubuntu2.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
 *** 2:3.6.3-2ubuntu2.1 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2:3.6.3-2ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

3. Logwatch reports/emails should contain samba log information.

4. No samba log information shows up in logwatch reports/emails.

Possible fix is to distribute the attached samba.conf in /usr/share/logwatch/dist.conf/logfiles/
It contains "LogFile=samba/*" which would revert logwatch's behavior to what it was in 10.04 for samba logs.
This will allow any type of log file naming you wish in your samba config in the /var/log/samba/ folder to be correctly parsed by logwatch.

Revision history for this message
Jacob Smith (jsmith-argotecinc) wrote :
Revision history for this message
Jacob Smith (jsmith-argotecinc) wrote :

Here is the source commit that changed the samba.conf. The reason listed was:
"samba.conf patch to deal with cores dir -mgt"
I have no idea what that means honestly but maybe it would be of help to know...

http://logwatch.svn.sourceforge.net/viewvc/logwatch?view=revision&revision=5

Robie Basak (racb)
Changed in logwatch (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I appreciate the detail in your report.

We certainly do want the default supplied by the logwatch package to match the default supplied by the samba package here, and it is clearly a bug that it doesn't.

I don't know what "samba.conf patch to deal with cores dir -mgt" is either, but it sounds to me like other files were ending up in /var/log/samba so samba.conf was narrowed down, but unfortunately in a way that does not match samba's default configuration.

It looks like samba upstream use log.* in their config examples, and Debian uses this by default. This suggests to me that the bug is in the logwatch upstream samba.conf, introduced in the revision that you identified, as well as a bug in Debian in addition to Ubuntu.

So the appropriate place for this patch to go is upstream, and if they reject it then Debian. Ubuntu will pick up the fix by proxy, and then we can fix it in 12.04 if that is appropriate.

So to progress this bug, please can you forward this bug upstream?

Revision history for this message
Jacob Smith (jsmith-argotecinc) wrote :

I will give it a whirl... not sure the exact (best) steps but I assume:

Submit a bug against Logwatch at SourceForge.net
Follow/answer questions there as needed.

If it gets patched then would I need to try to get Debian to pickup the patch before Ubuntu would consider an SRU to 12.04?

Revision history for this message
Robie Basak (racb) wrote :

Jacob,

You've got the steps right.

The latest development version of Ubuntu (currently Quantal) must be fixed before considering an SRU.

But how the development version is fixed is a little subjective. There isn't a specific rule; just the goal of minimising present and future work. The least ideal situation is for Ubuntu to be carrying a patch that neither upstream nor Debian carries. This is possible, but we want to keep the Ubuntu delta small to make future merges easier so we try and avoid it. And sometimes upstream or Debian fixes a problem differently, which causes additional work for us when we switch from our fix to their fix to minimise our delta.

Ideally, upstream will fix it, Debian will pick up the fix and we will merge it.

Revision history for this message
Jacob Smith (jsmith-argotecinc) wrote :

Just for the record and if anyone wants to check on it.

Upstream bug submitted:
http://sourceforge.net/tracker/?func=detail&aid=3536008&group_id=312875&atid=1316824#

Revision history for this message
Wesley Wiedenmeier (wesley-wiedenmeier) wrote :

Hi,

This was fixed in upsteam as of release 7.4.2, which is present in Xenial. The fix is not present in Trusty though, so I will prepare a debdiff including your patch as it was added by upstream for sru.

Thanks

Revision history for this message
Wesley Wiedenmeier (wesley-wiedenmeier) wrote :

The fix in upstream was at revision 246:
https://sourceforge.net/p/logwatch/code/246/#diff-1

Revision history for this message
Wesley Wiedenmeier (wesley-wiedenmeier) wrote :

Here's a debdiff for trusty that brings in the fix as it went into upstream. Note that it is slightly different than the patch attached to the bug.

A build including the this debdiff is available at:
https://launchpad.net/~wesley-wiedenmeier/+archive/ubuntu/test

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix_match_samba_logs.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
tags: added: regression-release
removed: regression
tags: added: precise trusty
Changed in logwatch (Ubuntu):
status: Triaged → Fix Released
Changed in logwatch (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

ACK on the debdiff in comment #9. I've uploaded a package to trusty-proposed (with a slight version change) for sponsoring by the SRU team.

Thanks!

Changed in logwatch (Ubuntu Trusty):
status: New → In Progress
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Jacob, or anyone else affected,

Accepted logwatch into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/logwatch/7.4.0+svn20130529rev144-1ubuntu1.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!

Changed in logwatch (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Wesley Wiedenmeier (wesley-wiedenmeier) wrote :
Download full text (3.2 KiB)

Since this bug had been inactive for quite a while previously the original reporter may no longer be following it.

I tested out the version in proposed, and can verify that the version in proposed finds the samba logs correctly. Since the patch only adds an additional rule to match the samba log files and does not remove the old rule, there is no real regression potential, other than users seeing output samba messages in their logwatch output that they had not been seeing before.

Verification procedure (note that samba was not configured and was did not start. the failure messages from it were still picked up by logwatch with the fix applied though. note also that if logwatch not matching the samba startup failure messages is considered a bug, it is separate from logwatch not reporting the samba logs at all):

root@unissuable-cade:~# apt-cache show logwatch | grep Version
    Version: 7.4.0+svn20130529rev144-1ubuntu1
root@unissuable-cade:~# sudo apt-get install samba
root@unissuable-cade:~# sudo service samba restart
        nmbd stop/waiting
        nmbd start/running, process 12562
        smbd stop/waiting
        smbd start/running, process 12574
        stop: Unknown instance:
        samba-ad-dc start/running, process 12589
root@unissuable-cade:~# logwatch --detail high --logdir /var/log/ --range all --service samba
    # no output, but /var/log/samba/log.%m has contents from restarting

root@unissuable-cade:/usr/share/logwatch/scripts# apt-cache show logwatch | grep Version
    Version: 7.4.0+svn20130529rev144-1ubuntu1.1
    Version: 7.4.0+svn20130529rev144-1ubuntu1
root@unissuable-cade:~# logwatch --detail high --logdir /var/log/ --range all --service samba

         ################### Logwatch 7.4.0 (05/29/13) ####################
                        Processing Initiated: Tue Sep 27 17:51:44 2016
                        Date Range Processed: all
                        Detail Level of Output: 10
                        Type of Output/Format: stdout / text
                        Logfiles for Host: unissuable-cade
         ##################################################################

         --------------------- samba Begin ------------------------

         **Unmatched Entries**
         ../lib/util/become_daemon.c:111(exit_daemon) STATUS=daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22 : 3 Time(s)
         ../lib/util/become_daemon.c:124(daemon_ready) STATUS=daemon 'nmbd' finished starting up and ready to serve connections : 2 Time(s)
         ../lib/util/become_daemon.c:124(daemon_ready) STATUS=daemon 'smbd' finished starting up and ready to serve connections : 2 Time(s)
         ../source4/smbd/server.c:477(binary_smbd_main) At this time the 'samba' binary should only be used for either: 'server role = active directory domain controller' or to access the ntvfs file server with 'server services = +smb' or the rpc proxy with 'dcerpc endpoint servers = remote' You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks : 3 Time(s)

         ---------------------- samba End -------...

Read more...

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package logwatch - 7.4.0+svn20130529rev144-1ubuntu1.1

---------------
logwatch (7.4.0+svn20130529rev144-1ubuntu1.1) trusty; urgency=medium

  * debian/patches/fix-match-samba-logs.patch: Fix match rules for samba logs
    (LP: #1010602)

 -- Wesley Wiedenmeier <email address hidden> Mon, 22 Aug 2016 23:14:26 -0500

Changed in logwatch (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for logwatch 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 regressions.

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.