Bug 1462615

Summary: Default installation does not report on systemd services requiring journalctl access to their logs
Product: [Fedora] Fedora Reporter: Ivor Durham <ivor.durham>
Component: logwatchAssignee: Jan Synacek <jsynacek>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 27CC: frank, gbcox, goeran, herrold, jsynacek, varekova
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-30 21:38:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ivor Durham 2017-06-19 05:29:48 UTC
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 16:49:17 UTC
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 17:26:02 UTC
(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 17:53:04 UTC
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-13 02:02:23 UTC
(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 08:11:23 UTC
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 17:56:31 UTC
hold against age out

Comment 7 Ben Cotton 2018-11-27 15:41:05 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. 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 '27'.

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 27 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 8 Ben Cotton 2018-11-30 21:38:33 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.