Files
portmaster/packaging/linux/portmaster.service
Alexandr Stelnykovych aea3aa4a2b linux: pass LOGLEVEL from the unit file, drop the unused PORTMASTER_ARGS
The unit file set LOGLEVEL=info and sourced /etc/default/portmaster, but
never passed the value to portmaster-core. Pass it as --log=${LOGLEVEL}.

An invalid level used to make ServiceConfig.Init fail, which would now turn
a mistyped LOGLEVEL into a service that does not start. Warn and fall back
to the default level instead, as the logger already does on its own.

PORTMASTER_ARGS was appended after "--", where cobra stops parsing flags and
the core ignores the rest, so it has had no effect since the v1 wrapper was
removed. Drop it, and replace the UI README instruction that relied on it
with the equivalent setting (Development Mode).
2026-10-15 12:54:54 +03:00

43 lines
1.6 KiB
Desktop File

[Unit]
Description=Portmaster by Safing
Documentation=https://safing.io
Documentation=https://docs.safing.io
Before=nss-lookup.target network.target shutdown.target
After=systemd-networkd.service
Conflicts=shutdown.target
Conflicts=firewalld.service
Wants=nss-lookup.target
[Service]
Type=simple
Restart=on-failure
RestartSec=10
RestartPreventExitStatus=24
LockPersonality=yes
MemoryDenyWriteExecute=yes
MemoryLow=2G
NoNewPrivileges=yes
PrivateTmp=yes
PIDFile=/var/lib/portmaster/core-lock.pid
Environment=LOGLEVEL=info
EnvironmentFile=-/etc/default/portmaster
ProtectSystem=true
ReadWritePaths=/usr/lib/portmaster
RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6
RestrictNamespaces=yes
ProtectHome=read-only
ProtectKernelTunables=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
PrivateDevices=yes
AmbientCapabilities=cap_chown cap_kill cap_net_admin cap_net_bind_service cap_net_broadcast cap_net_raw cap_sys_module cap_sys_ptrace cap_dac_override cap_fowner cap_fsetid cap_sys_resource cap_bpf cap_perfmon
CapabilityBoundingSet=cap_chown cap_kill cap_net_admin cap_net_bind_service cap_net_broadcast cap_net_raw cap_sys_module cap_sys_ptrace cap_dac_override cap_fowner cap_fsetid cap_sys_resource cap_bpf cap_perfmon
StateDirectory=portmaster
# TODO(ppacher): add --disable-software-updates once it's merged and the release process changed.
WorkingDirectory=/var/lib/portmaster
ExecStart=/usr/lib/portmaster/portmaster-core --log=${LOGLEVEL} --log-dir=/var/lib/portmaster/log
ExecStopPost=-/usr/lib/portmaster/portmaster-core --recover-iptables
[Install]
WantedBy=multi-user.target