# 2) try the postfix way
if (( _RC > 0 ))
then
_POSTFIX_BIN="$(command -v postfix 2>>${HC_STDERR_LOG})"
if [[ -x ${_POSTFIX_BIN} && -n "${_POSTFIX_BIN}" ]]
then
if (( $(${_POSTFIX_BIN} status 2>>${HC_STDERR_LOG} | grep -c -i 'is running' 2>/dev/null) == 0 ))
then
_RC=1
fi
else
warn "postfix is not installed here"
return 1
fi
fi
Reason: postfix status does not always return output on STDOUT/STDERR. Instead it hands its results to the postlog tool (-> syslog)
To fix: add an additional pgrep check:
# 3) try the pgrep way (note: old pgreps do not support '-c')
if (( _RC > 0 ))
then
(( $(pgrep -u postfix pickup 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
fi
Following code block does not always work:
```
# 2) try the postfix way
if (( _RC > 0 ))
then
_POSTFIX_BIN="$(command -v postfix 2>>${HC_STDERR_LOG})"
if [[ -x ${_POSTFIX_BIN} && -n "${_POSTFIX_BIN}" ]]
then
if (( $(${_POSTFIX_BIN} status 2>>${HC_STDERR_LOG} | grep -c -i 'is running' 2>/dev/null) == 0 ))
then
_RC=1
fi
else
warn "postfix is not installed here"
return 1
fi
fi
```
Reason: `postfix status` does not always return output on STDOUT/STDERR. Instead it hands its results to the `postlog tool` (-> syslog)
To fix: add an additional pgrep check:
```
# 3) try the pgrep way (note: old pgreps do not support '-c')
if (( _RC > 0 ))
then
(( $(pgrep -u postfix pickup 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
fi
```
patrick
added the buglinux labels 2020-05-09 10:08:24 +02:00
patrick
self-assigned this 2020-05-09 10:08:24 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Following code block does not always work:
Reason:
postfix statusdoes not always return output on STDOUT/STDERR. Instead it hands its results to thepostlog tool(-> syslog)To fix: add an additional pgrep check:
Fixed in 2020-05-08