Page MenuHomeDevCentral

Configure a dedicated syslog file for carp-ovh logs
ClosedPublic

Authored by yousra on Thu, Apr 2, 12:50.
Tags
None
Referenced Files
F26417403: D4036.id10670.diff
Wed, Apr 22, 17:44
F26365997: D4036.id10692.diff
Wed, Apr 22, 07:24
F26365994: D4036.id10670.diff
Wed, Apr 22, 07:24
Unknown Object (File)
Tue, Apr 21, 18:11
Unknown Object (File)
Tue, Apr 21, 18:11
Unknown Object (File)
Tue, Apr 21, 18:11
Unknown Object (File)
Tue, Apr 21, 18:11
Unknown Object (File)
Mon, Apr 20, 14:41

Details

Summary

This change adds:

  • a dedicated log file at /var/log/carp.log
  • a syslog configuration file in /usr/local/etc/syslog.d/carp.conf to redirect carp-ovh logs to /var/log/carp.log
  • a newsyslog configuration file in /etc/newsyslog.conf.d/carp.conf to rotate and compress carp log files

Ref T2292

Test Plan
  • salt 'router-003' state.apply roles/router
  • salt 'router-002' state.apply roles/router
  • Restart syslogd
  • Simulate failover
  • Verify the logs for carp-ovh is written to /var/log/carp.log with tail -f /var/log/carp.log

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Skipped
Unit
No Test Coverage
Branch
arcpatch-D4036_1
Build Status
Buildable 6643
Build 6929: arc lint + arc unit

Event Timeline

yousra requested review of this revision.Thu, Apr 2, 12:50
yousra created this revision.

carp-ovh logs were written both to /var/log/messages and /var/log/carp.log.
This change redirects them only to /var/log/carp.log by excluding them from /var/log/messages.

The "~" discard rule was not suitable because /etc/syslog.conf is processed before /usr/local/etc/syslog.d/carp.conf.
So logs are already written to /var/log/messages at that stage.

  • '0XXX" into XXX : correct permissions for Salt

I reordered the arguments, placing mode after makedirs

roles/router/carp/init.sls
44

Actually, newsyslog will create that file with the C flag you put in /var/log/carp.log root:wheel 644 7 1000 * JC, so we can remove this block.

Removed /var/log/carp.log state because it is created automatically by newsyslog.

This revision is now accepted and ready to land.Sun, Apr 19, 16:59