public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output
@ 2026-06-11  9:25 Dominik Csapak
  0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2026-06-11  9:25 UTC (permalink / raw)
  To: pmg-devel

Output from a custom check script on stderr gets printed to the syslog
with the qid in front so it gets picked up by the log tracker.

This would resulut in the log tracker output being something like:
`pmg-smtp-filter[4509]: 1093B6A2A7C7E9C6C9: custom check: DEBUG:#012`

remove the trailing newline in `log_err` with `chomp` to prevent the
`#012` ending up in the syslog and thus log-tracker output.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/PMG/Utils.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
index 913679b..80fab76 100644
--- a/src/PMG/Utils.pm
+++ b/src/PMG/Utils.pm
@@ -404,6 +404,7 @@ sub analyze_custom_check {
 
         my $log_err = sub {
             my ($errmsg) = @_;
+            chomp ($errmsg);
             syslog('err', '%s', "$queue->{logid}: custom check: $errmsg");
         };
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-11  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  9:25 [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal