Browse Source

Stop exim daemon when removing excess processes

Bob Mottram 6 years ago
parent
commit
5442dd106c
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/freedombone-base-email

+ 3
- 1
src/freedombone-base-email View File

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