diff --git a/target/getmail/getmail-service.sh b/target/getmail/getmail-service.sh index 98bc7bf9..725fe0f4 100644 --- a/target/getmail/getmail-service.sh +++ b/target/getmail/getmail-service.sh @@ -11,14 +11,18 @@ GETMAIL_DIR=/var/lib/getmail # Otherwise 'supervisorctl restart getmail' leads to zombie 'sleep' processes. trap 'pkill --parent $$' EXIT +function _syslog_error() { + logger --id --priority mail.err -t getmail6 "$*" +} + function _stopService() { - _log 'warn' "Stopping getmail service" + _syslog_error "Stopping service" exec supervisorctl stop getmail } # Verify the correct value for GETMAIL_POLL. Valid are any numbers greater than 0. if ! [[ ${GETMAIL_POLL} =~ ^[0-9]+$ && ${GETMAIL_POLL} -gt 0 ]]; then - _log 'warn' "Invalid value for GETMAIL_POLL: ${GETMAIL_POLL}" + _syslog_error "Invalid value for GETMAIL_POLL: ${GETMAIL_POLL}" _stopService fi @@ -35,7 +39,7 @@ while :; do # Stop service if no configuration is found. if [[ -z ${RC_FILE} ]]; then - _log 'warn' 'No getmail configration found' + _syslog_error 'No configration found' _stopService fi