#1149586 icinga2-common: icinga's logrotate emits "Error while parsing command-line options: the argument for option '--pid' is invalid"

#1149586#5
Date:
2026-10-01 08:04:52 UTC
From:
To:
Dear maintainer,

I am getting from cron:

    /etc/cron.daily/logrotate:
    [2026-10-01 06:00:29 +0200] critical/icinga-app: Error while parsing command-line options: the argument for option '--pid' is invalid

I propose to:

    # diff -u icinga2 icinga2.patched
    --- icinga2     2026-07-07 06:21:07.000000000 +0200
    +++ icinga2.patched     2026-10-01 09:49:57.936790425 +0200
    @@ -7,7 +7,7 @@
            notifempty
            create 644 nagios nagios
            postrotate
    -               /usr/sbin/icinga2 internal signal --sig SIGUSR1 --pid "$(cat /run/icinga2/icinga2.pid 2> /dev/null)" 2> /dev/null || true
    +               /usr/sbin/icinga2 internal signal --sig SIGUSR1 --pid "$(cat /run/icinga2/icinga2.pid 2> /dev/null)" &> /dev/null || true
            endscript
     }

However a better fix would probably be to have the icinga2 binary emit its option parsing errors on STDERR instead of emitting them on STDOUT...

This same problem is probably present upstream.

Thanks a log for maintaining icinga <3!
*t