From: Petter Reinholdtsen Date: Tue, 24 Jun 2025 05:47:33 +0000 (+0200) Subject: Start firewall rules before network is brought up. X-Git-Tag: archive/raspbian/1.6.9-3+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a922d211b84a436ea00b22c8f4985c1f43a9b551;p=opensnitch.git Start firewall rules before network is brought up. Forwarded: https://github.com/evilsocket/opensnitch/pull/1019 Last-Update: 2025-04-20 Also protect the firewall daemon from the kernel OOM killer. Partly based on proposal from https://github.com/evilsocket/opensnitch/pull/1019/. Gbp-Pq: Name 1030-systemd-service-earlier.patch --- diff --git a/daemon/opensnitchd.service b/daemon/opensnitchd.service index 3f05fad..3bfd94d 100644 --- a/daemon/opensnitchd.service +++ b/daemon/opensnitchd.service @@ -1,6 +1,10 @@ [Unit] Description=Application firewall OpenSnitch Documentation=https://github.com/evilsocket/opensnitch/wiki +DefaultDependencies=no +Before=network-pre.target shutdown.target +Wants=network-pre.target +Conflicts=shutdown.target [Service] Type=simple @@ -10,6 +14,9 @@ ExecStart=/usr/local/bin/opensnitchd -rules-path /etc/opensnitchd/rules Restart=always RestartSec=30 TimeoutStopSec=10 +# Ensure it is not killed by the Linux kernel's Out-Of-Memory (OOM) killer. +# https://www.freedesktop.org/software/systemd/man/systemd.exec.html#OOMScoreAdjust= +OOMScoreAdjust=-1000 [Install] -WantedBy=multi-user.target +WantedBy=basic.target