Răsfoiți Sursa

Correcting path for clamav-daemon.service

dpeca 9 ani în urmă
părinte
comite
fa73d16538
2 a modificat fișierele cu 9 adăugiri și 5 ștergeri
  1. 2 2
      install/vst-install-debian.sh
  2. 7 3
      upd/update-debian8-v16-to-v17.sh

+ 2 - 2
install/vst-install-debian.sh

@@ -1045,8 +1045,8 @@ if [ "$clamd" = 'yes' ]; then
         mkdir /var/run/clamav
     fi
     chown -R clamav:clamav /var/run/clamav
-    if [ -f "/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" ]; then
-        file="/etc/systemd/system/multi-user.target.wants/clamav-daemon.service"
+    if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
+        file="/lib/systemd/system/clamav-daemon.service"
         if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
             sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
         fi

+ 7 - 3
upd/update-debian8-v16-to-v17.sh

@@ -121,10 +121,14 @@ fi
 
 
 # Fixing /var/run/clamav permissions
-if [ -f "/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" ]; then
-    file="/etc/systemd/system/multi-user.target.wants/clamav-daemon.service"
+if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
+    file="/lib/systemd/system/clamav-daemon.service"
     if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
         sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
-        service clamav-daemon restart
+        if [ ! -d "/var/run/clamav" ]; then
+            mkdir /var/run/clamav
+        fi
+        chown -R clamav:clamav /var/run/clamav
+        service clamav-daemon restart /dev/null 2>&1
     fi
 fi