Bug 923111 - cronie-anacron log format should be changed
Summary: cronie-anacron log format should be changed
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: crontabs
Version: 20
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-19 08:58 UTC by Ignas
Modified: 2015-06-30 00:37 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-30 00:37:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
run-parts patch (903 bytes, patch)
2013-04-01 11:33 UTC, Wesley Hearn
no flags Details | Diff

Description Ignas 2013-03-19 08:58:29 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0
Build Identifier: 

Example cronie-anacron log event:
Mar 18 14:01:01 noc-ik run-parts(/etc/cron.hourly)[28993]: starting 0anacron

The problem is, syslog applications (notably rsyslog, which is default in Fedora and RHEL), takes "run-parts(/etc/cron.hourly)[28993]:" as a TAG part, and truncates it to 32 chars when forwarding (as per RFC 3164, 4.1.3)

The result is malformed syslog event, when received:
Mar 18 16:32:55 c01 run-parts(/etc/cron.hourly)[1592 starting 0anacron

From there on, it brakes log monitoring applications, that uses filters to analyze log messages.

Reproducible: Always

Steps to Reproduce:
1. Install cronie-anacron, tcpdump.
2. echo '*.*  @localhost:5000' >> /etc/rsyslog.conf; service rsyslog restart
3. tcpdump -i lo port 5000 -nnA
4. run-parts /etc/cron.hourly
5. watch tcpdump output
Actual Results:  
tcpdump output (see truncated pid number):
16:32:55.355467 IP6 ::1.49052 > ::1.5000: UDP, length 74
`....R.@.....................................R(.<77>Mar 18 16:32:55 c01 run-parts(/etc/cron.hourly)[1592 starting 0anacron

Expected Results:  
The whole message should should be transfered.

In my opinion, programs should not put arbitrary information to the TAG field. TAG should contain only program name (run-parts) and pid [123].

I would suggest moving "(/etc/cron.hourly)" part to MESSAGE field. Compare:
Mar 18 16:32:55 c01 run-parts(/etc/cron.hourly)[15920]: starting 0anacron
Mar 18 16:32:55 c01 run-parts[15920]: (/etc/cron.hourly) starting 0anacron

rsyslog discussion:
http://lists.adiscon.net/pipermail/rsyslog/2013-March/031952.html

Comment 1 Wesley Hearn 2013-04-01 11:33:35 UTC
Created attachment 730250 [details]
run-parts patch

Patch for run-parts, made for RHEL6.4 should be easy to adapt for Fedora.

Comment 2 Tomas Mraz 2013-04-02 07:17:02 UTC
Why did you change the run-parts to runparts in the patch when the script is really called run-parts. I wouldn't change this.

Comment 3 Wesley Hearn 2013-04-02 13:50:04 UTC
You know that is a good question, feel free to keep the hyphen in.

Comment 4 Fedora End Of Life 2013-07-04 06:20:24 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 WONTFIX if it remains open with a Fedora 
'version' of '17'.

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 prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 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 to Fedora 17's end of life.

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 5 Marcela Mašláňová 2013-08-30 15:11:10 UTC
Thanks, pushed as d9d62bb16946034691e7d3489b6ed25ff1df2d94

Comment 6 Fedora End Of Life 2013-09-16 16:55:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 7 Evan Rempel 2014-05-30 15:35:36 UTC
The two logger command in run-parts log different PID making it near impossible to pair the runished line with the starting line.

logger -p cron.notice -t "runparts[$$]" "($1) starting $(basename $i)"
logger -i -p cron.notice -t "runparts" "($1) finished $(basename $i)"

The first logs the PID of the run-parts script. The second logs the PID of the logger process that logs the finished line.

The second logger command should be

logger -p cron.notice -t "runparts[$$]" "($1) finished $(basename $i)"

to make the PID consistent.

Comment 8 Fedora Admin XMLRPC Client 2014-09-04 12:16:56 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Tomas Heinrich 2014-10-20 10:04:25 UTC
Hello,

bellow is an rsyslog configuration snippet to work around the issue with truncation.

The default format of forwarded messages is this:
"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%"

As you can see, the tag is truncated to 32 characters. To disable the truncation, use a modified template for forwarded messages:
$Template fwd,"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%"
$ActionForwardDefaultTemplate fwd

Comment 10 Fedora End Of Life 2015-05-29 08:56:19 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 '20'.

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 20 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 11 Fedora End Of Life 2015-06-30 00:37:39 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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.


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