Project

General

Profile

Bug #5799

system technique can only setup log settings *once* on syslog-ng

Added by Florian Heigl over 5 years ago. Updated about 4 years ago.

Status:
Released
Priority:
3
Category:
System techniques
Target version:
Severity:
User visibility:
Effort required:
Priority:

Description

The code to edit the respective syslog config files (i.e. syslog-ng) is not imdempotent.

If the entry is updated, it will at best create a second one.

The effect: i.e. the tcp/udp decision has to be made prior to clients applying the system techniques for the first time or it will be wrong on all clients and stay like it.

If they are meant to only run once in a lifetime, then please close and disregard.


Related issues

Related to Rudder - Bug #7635: syslog-ng's loghost regex does not match with set lineReleased2015-12-17Actions

Associated revisions

Revision 39ca4bd8 (diff)
Added by Matthieu CERDA about 5 years ago

Fixes #5799: Correct syslog-ng configuration maintenance

Revision 49003e61
Added by Jonathan CLARKE about 5 years ago

Merge pull request #593 from Kegeruneku/bug_5799/int/5799_correct_syslog_ng_line_maintenance

Fixes #5799: Correct syslog-ng configuration maintenance

History

#1

Updated by Nicolas CHARLES over 5 years ago

Hi Florian,

The configuration is expected to be idempotent, it looks at the server it sends to, and compares to the server it should send it to, but the comparaison checks also for udp/tcp (actually, always tcp unless on old syslog)

the issue here is that you changed the format, breaking the comparision

we should update the comparision to handle this case, but this does not happen in "standart" usage.

Note: rsyslog should be immune to this issue

#2

Updated by Florian Heigl over 5 years ago

Nuuuuu?

I don; think i changed the format, i'll paste examples after reproducing. Only changed the word tcp to the word udp.

#3

Updated by Nicolas CHARLES over 5 years ago

Oh, i must have not been clear.
Changing the work tcp to udp changes the format of the line for the comparision (it looks with a strict regex at lines that contains tcp)

#4

Updated by Matthieu CERDA about 5 years ago

  • Status changed from New to Pending technical review
  • Assignee set to Jonathan CLARKE
  • Priority changed from N/A to 3
  • Target version set to 2.6.20
  • % Done changed from 0 to 100
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/593

PR is ready: https://github.com/Normation/rudder-techniques/pull/593

Well, I see no "clean" way of doing this...

      "syslog_conf_comment"   string => "# Autogenerated by rudder, do not edit${const.n}";

      "syslog_ng_conf_prefix" string => "filter f_local_rudder{facility(local6) and program(\"rudder.*\");};destination loghost {tcp(\"";
      "syslog_ng_conf_suffix" string => "\" port (&SYSLOGPORT&));};log {source(${syslog_ng_source});filter(f_local_rudder);destination(loghost);";
      "syslog_ng_conf_final"  string => "flags(final);};";

      "syslog_ng_conf"        string => concat("${syslog_conf_comment}", "${syslog_ng_conf_prefix}", "${server_info.cfserved}", "${syslog_ng_conf_suffix}", "${syslog_ng_conf_final}");
      "syslog_ng_conf_regex"  string => concat("filter\ f\_local\_rudder\{facility\(local6\)\ and\ program\(\"rudder\.\*\"\)\;\}\;destination\ loghost\ \{(tcp|udp)\(\"", "[^\"]+", escape("${syslog_ng_conf_suffix}"), ".*");

I hope syslog-ng will support on all OS versions we work with a syslog-ng.d dir or something, so we can do something cleaner...

#5

Updated by Jonathan CLARKE about 5 years ago

  • Subject changed from system technique can only setup log settings *once* to system technique can only setup log settings *once* on syslog-ng

This only applied to syslog-ng, neither syslogd or rsyslog.

#6

Updated by Matthieu CERDA about 5 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset policy-templates:commit:39ca4bd861bbd4f8b2a11563de4e76191c87981b.

#7

Updated by Jonathan CLARKE about 5 years ago

Applied in changeset policy-templates:commit:49003e616ce3613311759e6de16bc3832ce89b8a.

#8

Updated by Vincent MEMBRÉ about 5 years ago

  • Target version changed from 2.6.20 to 2.10.8

2.6.20 will n ot be released, those issue will be fixed in 2.10.8

#9

Updated by Vincent MEMBRÉ about 5 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.8 and 2.11.5, which were released today (16/12/14)

#10

Updated by Benoît PECCATTE about 4 years ago

  • Target version changed from 2.10.8 to 2.6.20
#11

Updated by Vincent MEMBRÉ about 4 years ago

  • Related to Bug #7635: syslog-ng's loghost regex does not match with set line added

Also available in: Atom PDF