Page MenuHomeDevCentral

Configure a dedicated syslog file for carp-ovh logs
Needs ReviewPublic

Authored by yousra on Thu, Apr 2, 12:50.
Tags
None
Referenced Files
F25833865: D4036.id10550.diff
Sat, Apr 18, 13:57
F25792854: D4036.diff
Sat, Apr 18, 08:10
Unknown Object (File)
Fri, Apr 17, 01:44
Unknown Object (File)
Thu, Apr 16, 00:32
Unknown Object (File)
Wed, Apr 15, 20:53
Unknown Object (File)
Wed, Apr 15, 01:19
Unknown Object (File)
Tue, Apr 14, 09:15
Unknown Object (File)
Mon, Apr 13, 15:52

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
Build Status
Buildable 6578
Build 6862: 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.