Skip to content

Commit dff8815

Browse files
authored
Update opensnitchd.service
See: #1018
1 parent 57838e8 commit dff8815

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

daemon/opensnitchd.service

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
11
[Unit]
22
Description=Application firewall OpenSnitch
3-
Documentation=https://github.com/evilsocket/opensnitch/wiki
3+
Documentation=https://github.com/gustavo-iniguez-goya/opensnitch/wiki
4+
Documentation=man:systemd.special
5+
Documentation=man:systemd.service
6+
Documentation=man:systemd.exec
7+
Documentation=man:systemd.unit
8+
9+
DefaultDependencies=no
10+
Before=network-pre.target shutdown.target
11+
Wants=network-pre.target
12+
Conflicts=shutdown.target
13+
# Don't start when 'no-appfw` is in kernel command-line, to allow booting without it.
14+
ConditionKernelCommandLine=!no-appfw
415

516
[Service]
6-
Type=simple
7-
PermissionsStartOnly=true
8-
ExecStartPre=/bin/mkdir -p /etc/opensnitchd/rules
9-
ExecStart=/usr/local/bin/opensnitchd -rules-path /etc/opensnitchd/rules
17+
Type=exec
18+
ConfigurationDirectory=%N/rules
19+
ConfigurationDirectoryMode=0700
20+
21+
Environment='custom_cfg=%E/%N/rules'
22+
# Environment='opts=-debug'
23+
24+
ExecCondition=%N -check-requirements
25+
ExecStart=%N -rules-path $custom_cfg $opts
26+
27+
# Signal-info was taken from the init.d script, but it just exits and then systemd restarts the service...
28+
ExecReload=kill -HUP $MAINPID
1029
Restart=always
1130
RestartSec=30
1231
TimeoutStopSec=10
32+
# Ensure it is not killed by the Linux kernel's Out-Of-Memory (OOM) killer.
33+
# https://www.freedesktop.org/software/systemd/man/systemd.exec.html#OOMScoreAdjust=
34+
OOMScoreAdjust=-1000
1335

1436
[Install]
15-
WantedBy=multi-user.target
37+
WantedBy=basic.target

0 commit comments

Comments
 (0)