Browse Source

Prevent mail processes from proliferating

Bob Mottram 6 years ago
parent
commit
3e913e5887
2 changed files with 12 additions and 0 deletions
  1. 11
    0
      src/freedombone-base-email
  2. 1
    0
      src/freedombone-upgrade

+ 11
- 0
src/freedombone-base-email View File

1663
     fi
1663
     fi
1664
 }
1664
 }
1665
 
1665
 
1666
+function prevent_mail_process_overrun {
1667
+    { echo '#!/bin/bash';
1668
+      echo "exim_ctr=\$(pgrep \"exim4\" | wc -l)";
1669
+      echo "if [ \"\$exim_ctr\" -gt 5 ]; then";
1670
+      echo '    exim -bp | exiqgrep -i | xargs exim -Mrm';
1671
+      echo 'fi'; } > /usr/bin/exim_check
1672
+    chmod +x /usr/bin/exim_check
1673
+    cron_add_mins 5 '/usr/bin/exim_check'
1674
+}
1675
+
1666
 function install_email {
1676
 function install_email {
1667
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
1677
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
1668
         return
1678
         return
1675
     check_email_address_exists
1685
     check_email_address_exists
1676
     install_email_basic
1686
     install_email_basic
1677
     configure_email_onion
1687
     configure_email_onion
1688
+    prevent_mail_process_overrun
1678
 
1689
 
1679
     mark_completed "${FUNCNAME[0]}"
1690
     mark_completed "${FUNCNAME[0]}"
1680
 }
1691
 }

+ 1
- 0
src/freedombone-upgrade View File

102
         email_disable_chunking
102
         email_disable_chunking
103
         rm /etc/exim4/exim4.conf.template.bak*
103
         rm /etc/exim4/exim4.conf.template.bak*
104
         email_update_onion_domain
104
         email_update_onion_domain
105
+        prevent_mail_process_overrun
105
         #defrag_filesystem
106
         #defrag_filesystem
106
 
107
 
107
         # reinstall tor from backports
108
         # reinstall tor from backports