Bug 1462615 - Default installation does not report on systemd services requiring journalctl access to their logs
Default installation does not report on systemd services requiring journalctl...
Status: NEW
Product: Fedora
Classification: Fedora
Component: logwatch (Show other bugs)
27
All Linux
high Severity high
: ---
: ---
Assigned To: Jan Synacek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-19 01:29 EDT by Ivor Durham
Modified: 2018-05-17 13:56 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ivor Durham 2017-06-19 01:29:48 EDT
After a clean (re-)installation of F25 and installing logwatch I found that services which no longer write their own log files were not being reported by logwatch. I was specifically looking for the sshd report which I was seeing prior to the re-installation.

Version-Release number of selected component (if applicable):

logwatch-7.4.3-3.fc25.noarch

Steps to Reproduce:
1. Clean F25 installation
2. dnf install logwatch
3. Execute logwatch

Actual results:

No report on sshd logins or, I think, any service for which there is no longer a logfile, even though /usr/share/logwatch/default.conf/services all refer to logfiles rather than a journalctl-based log.

Expected results:

Report section "SSHD BEGIN" through "SSHD END" reporting logins (esp. failed ones) via ssh.

Additional info:

With some guidance from "Bjorn" on the logwatch forum, I got logwatch to display information available only through journalctl. I had to create the following three files:

[1] /etc/logwatch/conf/services/sshd.conf containing:
LogFile = 
LogFile = null
*JournalCtl = "--output=cat --unit=sshd.service"

[2] /etc/logwatch/conf/logfiles/null.conf containing:

LogFile = null.log

[3] /var/log/null.log, a non-empty log file containing:
  This is a dummy log file to help logwatch show journalctl logs

With these three files in place my logwatch report now includes an SSHD section:

--------------------- SSHD Begin ------------------------ 

 
 Users logging in through sshd:
    durham:
       192.168.0.100: 5 times
 
 ---------------------- SSHD End -------------------------

NOTE: /usr/share/logwatch/scripts/journalctl contains the following text, but it is not correct for services that do not use their own log files:

# The purpose of this script is to pass the output of the journalctl
# command to the logwatch parsers.  The corresponding conf/logfile 
# can be simple.  The following example shows a logfile with two lines:
# LogFile = /dev/null
# *JournalCtl = "--output=cat --unit=service_name.service"

This might work on the logfiles configuration but not for a services configuration.

There might be a temptation to classify this as a documentation bug except that all of the /usr/share/logwatch/default.conf/services/*.conf files for systemd services won't generate the expected report section. They need to be modified for logwatch to produce any output. (Or you have to install another utility to duplicate entries from journalctl in their own log files.
Comment 1 Gerald Cox 2017-07-11 12:49:17 EDT
Changing to F26 because this still isn't fixed.  
I had to do a clean install of F25 Workstation and am not getting any output at all from Logwatch, even after the above changes
Comment 2 Ivor Durham 2017-07-11 13:26:02 EDT
(In reply to Gerald Cox from comment #1)
> Changing to F26 because this still isn't fixed.  
> I had to do a clean install of F25 Workstation and am not getting any output
> at all from Logwatch, even after the above changes

Try "sudo logwatch --debug 100" to see if the debugging output gives you any insight.
Comment 3 Göran Uddeborg 2017-07-11 13:53:04 EDT
You shouldn't use the "--output=cat" option, should you?  That removes the time stamp and process name from the output lines, parts that at least some logwatch patterns look for.

I have tried to do this on some of my systems, and it seems to work.  For example, my /etc/logwatch/conf/logfiles/cron.conf looks like this:

LogFile = 
LogFile = /etc/logwatch/conf/empty
*JournalCtl = "--no-pager --unit=crond.service"
*RemoveService = anacron
Comment 4 Gerald Cox 2017-07-12 22:02:23 EDT
(In reply to Ivor Durham from comment #2)
> (In reply to Gerald Cox from comment #1)
> > Changing to F26 because this still isn't fixed.  
> > I had to do a clean install of F25 Workstation and am not getting any output
> > at all from Logwatch, even after the above changes
> 
> Try "sudo logwatch --debug 100" to see if the debugging output gives you any
> insight.

I updated:
https://bugzilla.redhat.com/show_bug.cgi?id=864872
with more information.  The good people over at the Arch distro seem to have a good handle on it.
Comment 5 Fedora End Of Life 2018-05-03 04:11:23 EDT
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 6 R P Herrold 2018-05-17 13:56:31 EDT
hold against age out

Note You need to log in before you can comment on or make changes to this bug.