public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output
Date: Thu, 11 Jun 2026 11:25:30 +0200	[thread overview]
Message-ID: <20260611092536.1329194-1-d.csapak@proxmox.com> (raw)

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





                 reply	other threads:[~2026-06-11  9:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260611092536.1329194-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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