Browse Source

Fix clamd for Amazon Linux

cmstew 7 years ago
parent
commit
b1e0e6a2a5
1 changed files with 11 additions and 4 deletions
  1. 11 4
      install/vst-install-amazon.sh

+ 11 - 4
install/vst-install-amazon.sh

@@ -509,6 +509,7 @@ cp -r /etc/exim/* $vst_backups/exim >/dev/null 2>&1
 
 
 # Backup ClamAV configuration
 # Backup ClamAV configuration
 service clamd stop > /dev/null 2>&1
 service clamd stop > /dev/null 2>&1
+service clamd.scan stop > /dev/null 2>&1
 cp /etc/clamd.conf $vst_backups/clamd >/dev/null 2>&1
 cp /etc/clamd.conf $vst_backups/clamd >/dev/null 2>&1
 cp -r /etc/clamd.d $vst_backups/clamd >/dev/null 2>&1
 cp -r /etc/clamd.d $vst_backups/clamd >/dev/null 2>&1
 
 
@@ -626,6 +627,11 @@ if [ "$exim" != 'no' ]; then
     check_result $? "yum install failed"
     check_result $? "yum install failed"
 fi
 fi
 
 
+# Installing freshclam for Amazon Linux
+if [ "$clamd" != 'no' ]; then
+    yum -y install clamav-update
+    check_result $? "yum install failed"
+fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                     Configure system                     #
 #                     Configure system                     #
@@ -768,7 +774,7 @@ fi
 if [ "$exim" = 'yes' ]; then
 if [ "$exim" = 'yes' ]; then
     echo "MAIL_SYSTEM='exim'" >> $VESTA/conf/vesta.conf
     echo "MAIL_SYSTEM='exim'" >> $VESTA/conf/vesta.conf
     if [ "$clamd" = 'yes'  ]; then
     if [ "$clamd" = 'yes'  ]; then
-        echo "ANTIVIRUS_SYSTEM='clamav'" >> $VESTA/conf/vesta.conf
+        echo "ANTIVIRUS_SYSTEM='clamd.scan'" >> $VESTA/conf/vesta.conf
     fi
     fi
     if [ "$spamd" = 'yes' ]; then
     if [ "$spamd" = 'yes' ]; then
         echo "ANTISPAM_SYSTEM='spamassassin'" >> $VESTA/conf/vesta.conf
         echo "ANTISPAM_SYSTEM='spamassassin'" >> $VESTA/conf/vesta.conf
@@ -1126,9 +1132,10 @@ if [ "$clamd" = 'yes' ]; then
     gpasswd -a clam exim
     gpasswd -a clam exim
     gpasswd -a clam mail
     gpasswd -a clam mail
     cp -f $vestacp/clamav/clamd.conf /etc/
     cp -f $vestacp/clamav/clamd.conf /etc/
+    ln -s /etc/clamd.conf /etc/clamd.d/scan.conf
     cp -f $vestacp/clamav/freshclam.conf /etc/
     cp -f $vestacp/clamav/freshclam.conf /etc/
     mkdir -p /var/log/clamav /var/run/clamav
     mkdir -p /var/log/clamav /var/run/clamav
-    chown clam:clam /var/log/clamav /var/run/clamav
+    chown clam:clam /var/log/clamav /var/run/clamav /var/run/clamd.scan
     chown -R clam:clam /var/lib/clamav
     chown -R clam:clam /var/lib/clamav
     if [ "$release" -ge '7' ]; then
     if [ "$release" -ge '7' ]; then
         cp -f $vestacp/clamav/clamd.service /usr/lib/systemd/system/
         cp -f $vestacp/clamav/clamd.service /usr/lib/systemd/system/
@@ -1139,8 +1146,8 @@ if [ "$clamd" = 'yes' ]; then
         sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
         sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
         systemctl daemon-reload
         systemctl daemon-reload
     fi
     fi
-    chkconfig clamd on
-    service clamd start
+    chkconfig clamd.scan on
+    service clamd.scan start
     #check_result $? "clamd start failed"
     #check_result $? "clamd start failed"
 fi
 fi