Bug 16263 - Not logging any mail events (rsyslog needs fixing since upstream systemd changes)
Summary: Not logging any mail events (rsyslog needs fixing since upstream systemd chan...
Status: RESOLVED DUPLICATE of bug 16634
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: William Murphy
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-01 11:16 CEST by Marc Krämer
Modified: 2017-04-21 12:33 CEST (History)
4 users (show)

See Also:
Source RPM: rsyslog-8.4.2-6.mga5.x86_64
CVE:
Status comment:


Attachments

Description Marc Krämer 2015-07-01 11:16:11 CEST
After updating from Mageia 4 to 5, no more mails get logged in /var/log/mail/.

Reproducible: 

Steps to Reproduce:
Comment 1 Samuel Verschelde 2015-07-02 09:14:36 CEST
William (or Colin as I suspect this is related to systemd), can you help this user? Is it a bug or an expected change after migration to Mageia 5, requiring configuration changes?

CC: (none) => mageia, warrendiogenese

Comment 2 Colin Guthrie 2015-07-02 10:20:34 CEST
Firstly, does "journalctl -u postfix" show you such log messages?
Comment 3 Marc Krämer 2015-07-02 10:46:22 CEST
not, since systemd journal is disabled.
systemd's journal was not very handy, took long to get simple log entries & uses too much diskspace, so i decided in Mageia 4 to completely disable journal & reanabled rsyslog to write simple human-readable files
Comment 4 Marc Krämer 2015-07-02 11:23:53 CEST
I reenabled journalctl:
entries for dovecot & postfix get logged, but since they are different untis, you can't get a log of both together.
In systemd I don't see how to show the logging target, "tail -f", backup logs, have different log-sizes for processes,...

that is why I don't want to use journalctl - and I think there are many more good reasons.
Comment 5 Colin Guthrie 2015-07-02 11:34:33 CEST
(In reply to M K from comment #4)
> I reenabled journalctl:
> entries for dovecot & postfix get logged, but since they are different
> untis, you can't get a log of both together.

Yes you can:

  journalctl -u postfix -u dovecot

> In systemd I don't see how to show the logging target, "tail -f", backup
> logs, have different log-sizes for processes,...

Not sure what you mean by "logging target"? If you mean the syslog facility, you can access this via:

  journalctl _SYSLOG_FACILITY=2

If you mean the syslog identifier, then you can use

  journalctl _SYSLOG_IDENTIFIER=postfix/pickup

tail -f is (perhaps unsurprisingly) journalctl -f.

There is no concept of backup logs. There is just an overall size limit for all logs and an individual journal size. Everything is automatically rotated when needed. Compression is built in and the full index is always available without having to spend time decompressing and grepping.

> that is why I don't want to use journalctl - and I think there are many more
> good reasons.

For what it's worth, here is an article I read recently that doesn't specifically talk about journal logs but is relevent and you may find it interesting:

https://asylum.madhouse-project.org/blog/2015/05/05/grepping-logs-is-terrible/

Keep in mind that the journal is meant to be useful for the majority of people for the general use cases. Having recently had to fight with an old server without journal I can tell you that going back to the old ways is really hard once you get used to the features!

Ultimately it's your choice and I won't try and "convert" you, but can you confirm whether on not the journal sees those logs when rsyslog does not?

If it does, can you attach the output from "journalctl -u postfix -u dovecot -o verbose"?

Also if the output does exist, does installing the "rsyslog-journald" (and restarting rsyslog) restore the logging to files too?

Also FWIW, the journal cannot be disabled per-se (it's an essential part of system startup), but it can be configured to not log to disk and to only keep a very small amount in ram. I presume this is what you mean when you did when you said "journal is disabled" above?
Comment 6 Marc Krämer 2015-07-02 12:14:45 CEST
I'll read that article later - thanks.

rsyslog-journald did the first trick - was it changed since mga4? shouldn't rsyslog have a dependecy on that package?

by disabling, I meant, setting "Storage=none":
'"none" turns off all storage, all log data received will be dropped. Forwarding to other targets, such as the console, the kernel log buffer or a syslog daemon will still work however.'

CORRECTION:
rsyslog logging only works, if Storage is NOT none, volatile is ok. But as you can read from the man page (cite above) Storage=none should work with other syslog daemons as well.
Comment 7 Colin Guthrie 2015-07-02 12:24:19 CEST
(In reply to M K from comment #6)
> I'll read that article later - thanks.

No problem.

> rsyslog-journald did the first trick - was it changed since mga4? shouldn't
> rsyslog have a dependecy on that package?

It probably should IMO. I didn't do the rsyslog packaging so I'd be tempted to suggest it should just be merged into the main package and always included. If you install rsyslog, you pretty much want this.

It did change yeah.

In systemd 216 (from the NEWS file FYI):

        * journald will no longer forward all local data to another
          running syslog daemon. This change has been made because
          rsyslog (which appears to be the most commonly used syslog
          implementation these days) no longer makes use of this, and
          instead pulls the data out of the journal on its own. Since
          forwarding the messages to a non-existent syslog server is
          more expensive than we assumed we have now turned this
          off. If you run a syslog server that is not a recent rsyslog
          version, you have to turn this option on again
          (ForwardToSyslog= in journald.conf).

So I would say that the rsyslog packaging is not really ideal and we should fix it.

> by disabling, I meant, setting "Storage=none":
> '"none" turns off all storage, all log data received will be dropped.
> Forwarding to other targets, such as the console, the kernel log buffer or a
> syslog daemon will still work however.'
> 
> CORRECTION:
> rsyslog logging only works, if Storage is NOT none, volatile is ok. But as
> you can read from the man page (cite above) Storage=none should work with
> other syslog daemons as well.

Yeah, so FowardToSyslog= would still work with storage=none, but as rsyslog doesn't use this and instead "pulls" from journal I guess you need Storage=volatile to allow rsyslog to get it.

The man page is technically not wrong, but it's certainly misleading considering how rsyslog works. I'll prep a patch to add some extra details to the man page that mentioned how rsyslog is typically setup to clarify this.

Does this all make sense?
Comment 8 Samuel Verschelde 2015-07-02 12:27:34 CEST
Assigning the bug report to rsyslog maintainer, based on the recent comments.

Assignee: bugsquad => warrendiogenese
Summary: Not logging any mail events => Not logging any mail events (rsyslog needs fixing since upstream systemd changes)

Comment 9 Marc Krämer 2015-07-02 13:52:45 CEST
@all: thanks for your help so far!
Florian Hubold 2015-09-08 10:24:31 CEST

CC: (none) => doktor5000

Florian Hubold 2015-09-17 22:41:15 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=16634

Comment 10 Chris Denice 2015-09-24 18:39:28 CEST
https://bugs.mageia.org/show_bug.cgi?id=16634#c4

There is indeed a bug affecting the upgrade 4->5, otherwise any install of rsyslog and syslog-ng takes care of this already.

The fix is uninstall rsyslog and reinstall it.

PS: Just forget to set a case for $1 -eq 2

*** This bug has been marked as a duplicate of bug 16634 ***

Status: NEW => RESOLVED
CC: (none) => dirteat
Resolution: (none) => DUPLICATE

Comment 11 Chris Denice 2015-09-24 18:51:41 CEST
To Colin:
In fact, I don't understand why this has happened, there is an unconditional:

%post
%{_sbindir}/rsyslog_switchfwd %{journalcfgdir} on

that apparently is ignored during distro upgrade? Is that expected?
Bruno Cornec 2017-04-21 12:33:17 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=20712


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