Enhancement #2018

Remove escaped #012 (LF) in system logs

Added by Davide Principi about 8 years ago. Updated about 8 years ago.

Status:CLOSEDStart date:06/17/2013
Priority:NormalDue date:06/17/2013
Assignee:-% Done:

100%

Category:nethserver-lib
Target version:v6.4-beta2
Resolution: NEEDINFO:No

Description

Messages from e-smith::event in /var/log/messages have linefeed LF characters escaped:

Jun 11 14:39:40 nethservice esmith::event[16134]: expanding /etc/postfix/vmailbox#012
Jun 11 14:39:40 nethservice esmith::event[16134]: expanding /etc/postfix/internal_access#012
Jun 11 14:39:40 nethservice esmith::event[16134]: expanding /etc/postfix/virtual#012
Jun 11 14:39:42 nethservice esmith::event[16134]: adjusting service postfix (reload)#012
Jun 11 14:39:42 nethservice esmith::event[16134]: Reloading postfix: [  OK  ]#015#012
Jun 11 16:18:17 nethservice esmith::event[32745]: expanding /etc/postfix/vmailbox#012
Jun 11 16:18:17 nethservice esmith::event[32745]: expanding /etc/postfix/internal_access#012
Jun 11 16:18:17 nethservice esmith::event[32745]: expanding /etc/postfix/virtual#012
Jun 11 16:18:17 nethservice esmith::event[32745]: expanding /etc/postfix/aliases#012
Jun 11 16:18:20 nethservice esmith::event[32745]: Updated comment of group NETHESIS\faxmaster to Hylafax+ admins group#012
Jun 11 16:18:20 nethservice esmith::event[32745]: adjusting service postfix (reload)#012
Jun 11 16:18:21 nethservice esmith::event[32745]: Reloading postfix: [  OK  ]#015#012

We'd love not having them...

Currently this issue has been solved by SME Server in rsyslogd configuration:
http://bugs.contribs.org/show_bug.cgi?id=7662

Associated revisions

Revision 264d9bb0
Added by Davide Principi about 8 years ago

esmith::Logger (PRINT): trim ending newline before sending data to syslog(). Refs #2018

History

#1 Updated by Giacomo Sanchietti about 8 years ago

Not an elegant solution, but it shouldn't have big side effects.

#2 Updated by Davide Principi about 8 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

We can also trim whitespace in esmith::Logger module

#3 Updated by Davide Principi about 8 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#4 Updated by Davide Principi about 8 years ago

  • Due date set to 06/17/2013
  • Status changed from ON_DEV to MODIFIED
  • Start date set to 06/17/2013
  • % Done changed from 30 to 70
  • Estimated time set to 1.00

Test case

After an event has been signalled, log entries don't have '#012' escaped newlines:

   # grep esmith::event /var/log/messages
Jun 17 14:28:06 davidep2 esmith::event[10184]: Processing event: nethserver-samba-update 
Jun 17 14:28:06 davidep2 esmith::event[10184]: Running event handler: /etc/e-smith/events/nethserver-samba-update/S00initialize-default-databases
Jun 17 14:28:06 davidep2 esmith::event[10184]: Migrating existing database domains
Jun 17 14:28:06 davidep2 esmith::event[10184]: Migrating existing database accounts
Jun 17 14:28:06 davidep2 esmith::event[10184]: Migrating existing database networks
Jun 17 14:28:06 davidep2 esmith::event[10184]: Migrating existing database configuration
Jun 17 14:28:07 davidep2 esmith::event[10184]: S00initialize-default-databases=action|Event|nethserver-samba-update|Action|S00initialize-default-databases|Start|1371479286 129209|End|1371479287 360589|Elapsed|1.23138
Jun 17 14:28:07 davidep2 esmith::event[10184]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Jun 17 14:28:07 davidep2 esmith::event[10184]: expanding /etc/sudoers
Jun 17 14:28:07 davidep2 esmith::event[10184]: expanding /etc/hosts
Jun 17 14:28:07 davidep2 esmith::event[10184]: expanding /etc/nsswitch.conf
Jun 17 14:28:08 davidep2 esmith::event[10184]: expanding /etc/krb5.conf
...

#5 Updated by Davide Principi about 8 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Davide Principi)
  • % Done changed from 70 to 80

#6 Updated by Davide Principi about 8 years ago

In nethserver-testing
nethserver-lib-1.1.2-1.ns6.noarch.rpm

#7 Updated by Filippo Carletti about 8 years ago

Currently this issue has been solved by SME Server in rsyslogd configuration:
http://bugs.contribs.org/show_bug.cgi?id=7662

Would you mind suggesting your fix to sme bugtracker?

#8 Updated by Davide Principi about 8 years ago

Filippo Carletti wrote:

Would you mind suggesting your fix to sme bugtracker?

Of course! See http://bugs.contribs.org/show_bug.cgi?id=7662#c9

#9 Updated by Giacomo Sanchietti about 8 years ago

  • Assignee set to Giacomo Sanchietti

#10 Updated by Giacomo Sanchietti about 8 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 80 to 100

After package update, extract from /var/log/messages:

Jul 23 15:54:02 localhost esmith::event[16744]: Processing event: firewall-adjust 
Jul 23 15:54:02 localhost esmith::event[16744]: Running event handler: /etc/e-smith/events/firewall-adjust/S20firewall-adjust
Jul 23 15:54:03 localhost esmith::event[16745]: Processing event: lokkit-save firewall-adjust
Jul 23 15:54:03 localhost esmith::event[16745]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Jul 23 15:54:03 localhost esmith::event[16745]: expanding /etc/sysconfig/system-config-firewall

No escaped LF found.

Marking as VERIFIED.

#11 Updated by Davide Principi about 8 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

Moved to nethserver-updates repository

Also available in: Atom PDF