Stop exim daemon when removing excess processes

This commit is contained in:
Bob Mottram 2018-05-11 13:27:19 +01:00
parent 5e9efd52bf
commit 5442dd106c
1 changed files with 3 additions and 1 deletions

View File

@ -1669,7 +1669,9 @@ function prevent_mail_process_overrun {
{ echo '#!/bin/bash';
echo "exim_ctr=\$(pgrep \"exim4\" | wc -l)";
echo "if [ \"\$exim_ctr\" -gt 5 ]; then";
echo ' exim -bp | exiqgrep -i | xargs exim -Mrm';
echo ' systemctl stop exim4';
echo ' exim -bp | exiqgrep -i | xargs exim -Mrm 2> /dev/null';
echo ' systemctl start exim4';
echo 'fi'; } > /usr/bin/exim_check
chmod +x /usr/bin/exim_check
cron_add_mins 5 '/usr/bin/exim_check'