|
1 | 1 | [Unit] |
2 | 2 | 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 |
4 | 15 |
|
5 | 16 | [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 |
10 | 29 | Restart=always |
11 | 30 | RestartSec=30 |
12 | 31 | 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 |
13 | 35 |
|
14 | 36 | [Install] |
15 | | -WantedBy=multi-user.target |
| 37 | +WantedBy=basic.target |
0 commit comments