File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,11 +14,17 @@ SyslogIdentifier=logmailer
1414SyslogLevel =err
1515Type =oneshot
1616ExecStart =/bin/sh -euc '\
17- inv=$(systemctl ${SD_ARGS} show -P InvocationID %i | grep ^.) \n \
17+ sd_ver=$(systemctl --version | awk \' NR == 1 { print $2 }\' ) \n \
18+ filt= \n \
19+ if [ "$$sd_ver" -ge 257 ]; then \n \
20+ filt=$$filt" --unit %i --invocation=0" \n \
21+ else \n \
22+ inv=$(systemctl ${SD_ARGS} show -P InvocationID %i | grep ^.) \n \
23+ filt=$$filt" INVOCATION_ID=$$inv + USER_INVOCATION_ID=$$inv + _SYSTEMD_INVOCATION_ID=$$inv" \n \
24+ fi \n \
25+ [ "$$sd_ver" -ge 256 ] && echo %i | grep -Evq \' ^podman([.@]|$)\' && \n \
26+ filt=$$filt" --exclude-identifier=podman" \n \
1827 STATE=$(systemctl ${SD_ARGS} is-active %i || true) \n \
19- LOGS=$(journalctl ${SD_ARGS} --all --no-hostname \
20- INVOCATION_ID=$$inv \
21- + USER_INVOCATION_ID=$$inv \
22- + _SYSTEMD_INVOCATION_ID=$$inv) \n \
28+ LOGS=$(journalctl ${SD_ARGS} --all --no-hostname $$filt) \n \
2329 sendmail -i "$1" <<_TPL_EOF\n Subject: ${EMAIL_SUBJ}\n\n ${EMAIL_TPL}\n _TPL_EOF\n \
2430 ' -- $EMAIL_TGTS
You can’t perform that action at this time.
0 commit comments