Repository navigation
fix(syslog): stop appending the boot drive mirror rule on every apply - #2794
Junker der Provinz (junkerderprovinz) wants to merge 1 commit into
Conversation
In a basic regex \? is the optional operator, so the guard never matched the "*.debug ?flash" line that sed writes and each Apply added another copy. Every syslog line then went to the boot device once per copy. Fixes unraid#2782 Co-authored-by: Cloud-Tickler <127838436+Cloud-Tickler@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe flash-mirroring guard now searches for the literal ChangesFlash mirror rule
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
Fixes #2782
With "Mirror syslog to boot drive" set to Yes, every Apply on Settings > Syslog Server appended another
*.debug ?flashline to/etc/rsyslog.conf, and from there to/boot/config/rsyslog.conf. rsyslog then wrote each message to/boot/logs/syslogonce per copy.The guard is a plain
grep, so it reads the pattern as a basic regex. There\?is the optional operator, which means the guard matched*.debug flashbut never the*.debug ?flashline thatsedwrites. Dropping the backslash makes the?literal. The disable branch usessed -r, where\?already is a literal?, so it stays as it is.I ran the block with GNU grep against a scratch config, three applies each:
Servers that already have duplicates keep them until the mirror is switched off and on again.
Thanks Cloud-Tickler for the detailed report and the fix, which this PR applies as proposed.
Summary by CodeRabbit
?character.