mpd/systemd/user/mpd.service.in
naglis bdfe5e97cd systemd: base "RestrictAddressFamilies" on build options
This allows to not allow `AF_NETLINK` if `smbclient` is not enabled.
2023-09-15 23:39:00 +03:00

41 lines
1.0 KiB
SYSTEMD

[Unit]
Description=Music Player Daemon
Documentation=man:mpd(1) man:mpd.conf(5)
After=network.target sound.target
[Service]
Type=notify
ExecStart=@prefix@/bin/mpd --systemd
# Enable this setting to ask systemd to watch over MPD, see
# systemd.service(5). This is disabled by default because it causes
# periodic wakeups which are unnecessary if MPD is not playing.
#WatchdogSec=120
# allow MPD to use real-time priority 40
LimitRTPRIO=40
LimitRTTIME=infinity
# for io_uring
LimitMEMLOCK=64M
# Required in order for ProtectSystem= (and other sandboxing) to work
PrivateUsers=yes
# disallow writing to /usr, /bin, /sbin, ...
ProtectSystem=yes
# more paranoid security settings
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectControlGroups=yes
RestrictAddressFamilies=@address_families@
RestrictNamespaces=yes
# Note that "ProtectKernelModules=yes" is missing in the user unit
# because systemd 232 is unable to reduce its own capabilities
# ("Failed at step CAPABILITIES spawning /usr/bin/mpd: Operation not
# permitted")
[Install]
WantedBy=default.target