Project

General

Profile

Actions

Bug #5799

closed

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

Added by Florian Heigl over 9 years ago. Updated over 8 years ago.

Status:
Released
Priority:
3
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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 1 (0 open1 closed)

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

Updated by Nicolas CHARLES over 9 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

Actions #2

Updated by Florian Heigl over 9 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.

Actions #3

Updated by Nicolas CHARLES over 9 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)

Actions #4

Updated by Matthieu CERDA over 9 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...

Actions #5

Updated by Jonathan CLARKE over 9 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.

Actions #6

Updated by Matthieu CERDA over 9 years ago

  • Status changed from Pending technical review to Pending release

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

Actions #7

Updated by Jonathan CLARKE over 9 years ago

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

Actions #8

Updated by Vincent MEMBRÉ over 9 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

Actions #9

Updated by Vincent MEMBRÉ over 9 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)

Actions #10

Updated by Benoît PECCATTE over 8 years ago

  • Target version changed from 2.10.8 to 2.6.20
Actions #11

Updated by Vincent MEMBRÉ over 8 years ago

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

Also available in: Atom PDF