Bug 809916

Summary: systemd floods "/var/log/messages" when syslog-ng is used
Product: [openSUSE] openSUSE 12.3 Reporter: Klaus Singvogel <bugzilla>
Component: BasesystemAssignee: systemd maintainers <systemd-maintainers>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bugzilla, fbui, Markus.Elfring, peter, thomas.blume, werner
Version: FinalFlags: thomas.blume: needinfo? (bugzilla)
Target Milestone: ---   
Hardware: 64bit   
OS: openSUSE 12.3   
See Also: https://bugzilla.novell.com/show_bug.cgi?id=805309
Whiteboard:
Found By: Community User Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: syslog-ng.conf

Description Klaus Singvogel 2013-03-18 09:16:08 UTC
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

When booting openSUSE-12.3 and having syslog-ng chosen, the systemd floods /var/log/messages when the same message:

systemd[1]: syslog-ng.service start request repeated too quickly, refusing to start.

This message is around 1100 times in /var/log/messages.

This only happens when booting only.

The syslog-ng daemon is running as expected after boot: 1x.

The fault is the number of same messages in /var/log/messages.

Reproducible: Always




This is a openSUSE-12.3 bugzilla entry, but I cannot choose the 12.3 in selection field at the moment.
Comment 1 Marius Tomaschewski 2013-03-20 07:56:32 UTC
Could you provide the outputs of "systemctl status syslog.service"
and "systemctl status syslog-ng.service" please?
Comment 2 Klaus Singvogel 2013-03-20 08:00:19 UTC
As requested:

"systemctl status syslog.service"
syslog-ng.service - System Logging Service
          Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled)
          Active: active (running) since Sun, 2013-03-17 00:32:01 CET; 3 days ago
         Process: 1335 ExecStartPre=/usr/sbin/syslog-ng-service-prepare (code=exited, status=0/SUCCESS)
        Main PID: 1341 (syslog-ng)
          CGroup: name=systemd:/system/syslog-ng.service
                  â 1341 /usr/sbin/syslog-ng -F
---------------------------------------------

systemctl status syslog-ng.service
syslog-ng.service - System Logging Service
          Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled)
          Active: active (running) since Sun, 2013-03-17 00:32:01 CET; 3 days ago
         Process: 1335 ExecStartPre=/usr/sbin/syslog-ng-service-prepare (code=exited, status=0/SUCCESS)
        Main PID: 1341 (syslog-ng)
          CGroup: name=systemd:/system/syslog-ng.service
                  â 1341 /usr/sbin/syslog-ng -F
---------------------------------------------
Comment 3 peter czanik 2013-03-20 08:13:09 UTC
I have also seen it once, but at that time I could not figure out how to reproduce it.
Comment 4 Marius Tomaschewski 2013-03-20 08:15:23 UTC
Basically, the syslog-ng start is requested by each log message via
syslog.socket dependency. Did you increased the systemd log level,
so it logs each of these attempts?

But finally, syslog-ng should be able to suppress them. The default
config contains suppress(30) for /var/log/messages:

destination messages { file("/var/log/messages" suppress(30) owner(-1) group(-1) perm(-1)); };

Does your config contain it, could you attach /etc/syslog-ng/syslog-ng.conf
please?
Comment 5 Klaus Singvogel 2013-03-20 08:26:11 UTC
Created attachment 530586 [details]
syslog-ng.conf
Comment 6 Klaus Singvogel 2013-03-20 08:27:02 UTC
No, I didn't change systemd log level - btw. didn't know that this is possible.

Yes, I know that "suppress(30)" should reduce the number of messages, and checked it before opening the bugzilla entry. But
a) suppressing them is not the solution
b) suppress(30) is enabled and doesn't work.

Yes, I have a modified syslog-ng.conf file, but there are no changes, which are related here. 

But for sake of completeness, I've attached my modified syslog-ng.conf - see above
Comment 7 Marius Tomaschewski 2013-03-20 08:54:33 UTC
(In reply to comment #6)
> No, I didn't change systemd log level - btw. didn't know that this is
> possible.

OK, then I don't need to ask if you changed the
  /etc/systemd/{system.conf,journald.conf}
somehow or set some systemd.* boot parameters (cat /proc/cmdline)? ;-)

> Yes, I know that "suppress(30)" should reduce the number of messages, and
> checked it before opening the bugzilla entry. But
> a) suppressing them is not the solution

Not? I fear it is the only solution available.

Except of fixing the program that generates the message to not log
same message again and again -> something for "osc bugowner systemd"
in this case, not for "osc bugowner syslog-ng".

> b) suppress(30) is enabled and doesn't work.

Not? On my host the suppression generally works:

# grep suppress /var/log/messages

shows me message lines like:

systemd: Last message 'Deactivating swap /d' repeated 2 times, suppressed by syslog-ng

# for i in {1..30} ; do logger baaaaaaaaarrrrrrrr ; done
# logger flood end
# grep baaa /var/log/messages
...: baaaaaaaaarrrrrrrr
...: Last message 'baaaaaaaaarrrrrrrr' repeated 29 times, suppressed by syslog-ng on ...

> Yes, I have a modified syslog-ng.conf file, but there are no changes,
> which are related here. 
> 
> But for sake of completeness, I've attached my modified syslog-ng.conf
> - see above

Yes... your config looks fine and contains the suppress option for
/var/log/messages.

In your message there is also no "[ xxx.yyyyyyyy]" kernel like monotonic
clock timestamp in the front of the message which could make them look
unique ... right?
Comment 8 Marius Tomaschewski 2013-03-20 09:03:42 UTC
OK, IMO I've verified that syslog-ng suppression works fine and there
seems to be no misconfiguration causing it on syslog-ng side.

Reassign to systemd maintainer - Frederic, any Idea?
Either there is come config option set somehow or systemd tends to flood
here logging a message while every of the 1100 checks if syslog daemon is
already or not; it should do things like this only in debug mode IMO.
Comment 9 Klaus Singvogel 2013-03-20 09:06:19 UTC
> if you changed the
>   /etc/systemd/{system.conf,journald.conf}
> somehow or set some systemd.* boot parameters (cat /proc/cmdline)?

No change made.

> Not? I fear it is the only solution available.

This is only fixing the symptoms not the cause.

> Not? On my host the suppression generally works:

sorry, for misunderstanding. At my side suppress() works in general too:
# grep -c suppress /var/log/messages
  4

but suppress() doesn't work for this issue.

> In your message there is also no "[ xxx.yyyyyyyy]" kernel like monotonic
> clock timestamp in the front of the message which could make them look
> unique ... right?

I cut it away: unnecessary information for bug report when boot
time, and sytem time was.

But I think this is the reason why suppress() doesn't work: the kernel
time is measured in microseconds, and is part of the log message too.
So the message is constantly changing, and suppress() cannot find duplicates
therefore.
Comment 10 Juergen Weigert 2013-03-20 09:16:51 UTC
*** Bug 810331 has been marked as a duplicate of this bug. ***
Comment 11 Frederic Crozat 2013-03-20 09:25:12 UTC
It might be worth testing Fedora patch http://pkgs.fedoraproject.org/cgit/syslog-ng.git/tree/syslog-ng-3.3.6-syslog-ng.service.patch?h=f18 to ensure systemd considers syslog-ng "up and running" only when the PID file is created.

Also, comparing what Fedora is doing, they are using :
    file ("/proc/kmsg" program_override("kernel") flags(kernel));
instead of:
        file ("/proc/kmsg" program_override("kernel"));

(not sure it is related..)
Comment 12 peter czanik 2013-03-20 10:39:01 UTC
@Frederic: the following branch for the upcoming syslog-ng 3.5 version has some patches, which will help syslog-ng to emit proper systemd status messages. It's currently unmerged and untested. Will this be a proper resolution for the problem, once available?
https://github.com/algernon/syslog-ng/commits/feature/3.5/systemd/goodies
Comment 13 Frederic Crozat 2013-03-20 11:46:26 UTC
(In reply to comment #12)
> @Frederic: the following branch for the upcoming syslog-ng 3.5 version has some
> patches, which will help syslog-ng to emit proper systemd status messages. It's
> currently unmerged and untested. Will this be a proper resolution for the
> problem, once available?
> https://github.com/algernon/syslog-ng/commits/feature/3.5/systemd/goodies

probably. But maybe adding PID option would be enough
Comment 14 Dr. Werner Fink 2013-11-27 13:10:46 UTC
(In reply to comment #13)

Are there any news?
Comment 15 peter czanik 2013-11-27 13:37:00 UTC
syslog-ng 3.5.1 is released, but without man pages, so I'm waiting for 3.5.2 before sending it to Base:System and Factory.
Comment 16 Franck Bui 2015-07-01 08:53:37 UTC
Can we consider this issue resolved ?

I can't reproduce on my opensuse 13.1 and I don't think this has been seen again since this report.
Comment 17 Thomas Blume 2015-07-01 13:24:43 UTC
(In reply to Franck Bui from comment #16)
> Can we consider this issue resolved ?
> 
> I can't reproduce on my opensuse 13.1 and I don't think this has been seen
> again since this report.

syslog-ng is quite obsolete and has been replaced by rsyslog in 13.1.
Version 12.3 is out of maintenance anyway, so IMHO, you can close this bug.
Comment 18 Klaus Singvogel 2015-07-01 14:03:17 UTC
(In reply to Thomas Blume from comment #17)
> syslog-ng is quite obsolete and has been replaced by rsyslog in 13.1.
> Version 12.3 is out of maintenance anyway, so IMHO, you can close this bug.

Then you installed a different openSUSE 13.2 than me.

I found source package syslog-ng in official tree (and already replace rsyslog with it):

http://download.opensuse.org/repositories/openSUSE:/13.2/standard/src/syslog-ng-3.5.6-3.1.4.src.rpm
Comment 19 Thomas Blume 2015-07-02 07:10:11 UTC
(In reply to Klaus Singvogel from comment #18)
> (In reply to Thomas Blume from comment #17)
> > syslog-ng is quite obsolete and has been replaced by rsyslog in 13.1.
> > Version 12.3 is out of maintenance anyway, so IMHO, you can close this bug.
> 
> Then you installed a different openSUSE 13.2 than me.
> 
> I found source package syslog-ng in official tree (and already replace
> rsyslog with it):
> 
> http://download.opensuse.org/repositories/openSUSE:/13.2/standard/src/syslog-
> ng-3.5.6-3.1.4.src.rpm

Yes, it is still available but per default rsyslog is installed.
I was not aware that someone still cares about syslog-ng, sorry.

So the newer syslog-ng version (comment#15) in 13.2 still shows the issue?
If so, would you mind opening a bug against 13.2 or updating the product version in this bug?
Comment 20 Franck Bui 2015-07-02 09:30:08 UTC
Dont seem to be present on opensuse 13.2:

linux-nypb:~ # grep syslog /var/log/messages 
Jul  2 11:28:04 linux-nypb syslog-ng[500]: syslog-ng starting up; version='3.5.6'
linux-nypb:~ #
Comment 21 Franck Bui 2015-07-02 09:55:06 UTC
This bug was initially reported for opensuse 12.3 which is not supported anymore.

Also I couldn't reproduce it on supported platforms opensuse 13.1/13.2

So closing the bug.