Преглед на файлове

rpm: fix misleading systemd warnings during upgrade

systemctl preset output lengthy warning when trying to operate on
non-existing unit. This preset action is meant to disable unit, so it's
even better it doesn't exists.
Marek Marczykowski-Górecki преди 7 години
родител
ревизия
4996dd7609
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6 2
      rpm_spec/core-vm.spec

+ 6 - 2
rpm_spec/core-vm.spec

@@ -600,8 +600,12 @@ else
     done
     /bin/systemctl --no-reload preset qubes-update-check.timer
     # Upgrade path - now qubes-iptables is used instead
-    /bin/systemctl --no-reload preset iptables.service
-    /bin/systemctl --no-reload preset ip6tables.service
+    if [ -f /lib/systemd/system/iptables.service ]; then
+        /bin/systemctl --no-reload preset iptables.service
+    fi
+    if [ -f /lib/systemd/system/ip6tables.service ]; then
+        /bin/systemctl --no-reload preset ip6tables.service
+    fi
 fi
 
 # Set default "runlevel"