Commit Graph

38 Commits

Author SHA1 Message Date
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
naglis
df069bc456 systemd: base "ListenStream" on build options
Make `mpd.socket` configurable based on build options, so that e.g.
`ListenStream=6600` is not added if `tcp` option is not enabled.
2023-09-15 23:38:59 +03:00
Max Kellermann
9c19368fc7 Merge branch 'v0.23.x' 2023-06-02 14:36:02 +02:00
Simon Arlott
561d6fd478 meson: Use correct prefix for systemd_system_unit_dir
systemd uses "rootprefix", not "prefix" for this value

059b1b31ad/src/core/systemd.pc.in (L23)
2023-06-02 14:33:13 +02:00
Naïm Favier
42a01822bf meson: use correct prefix for systemd dirs
See https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

Fixes the build in nixpkgs
2023-06-02 14:33:09 +02:00
Naïm Favier
838af929a0 meson: use correct prefix for systemd dirs
See https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

Fixes the build in nixpkgs
2023-05-22 22:23:38 +02:00
Max Kellermann
4bb4611e78 Merge branch 'v0.23.x' 2023-05-21 21:18:45 +02:00
Michiel Beijen
f7eb1c9a83 Fix meson build warning for get_pkgconfig_variable
Otherwise, building will generate these warnings:

systemd/system/meson.build:5: WARNING: Project targeting '>= 0.56.0' but tried to use feature deprecated since '0.56.0': Dependency.get_pkgconfig_variable. use Dependency.get_variable(pkgconfig : ...) instead
systemd/user/meson.build:5: WARNING: Project targeting '>= 0.56.0' but tried to use feature deprecated since '0.56.0': Dependency.get_pkgconfig_variable. use Dependency.get_variable(pkgconfig : ...) instead
2023-05-21 21:07:14 +02:00
kaliko
4ec6d0555a check systemd unit dir from systemd.pc in meson 2023-05-21 20:51:33 +02:00
kaliko
0d2f67b523 check systemd unit dir from systemd.pc in meson 2023-04-11 21:06:53 +02:00
Luca Boccassi
714bb991aa systemd: use PrivateUsers= in user unit
ProtectSystem= and other sandboxing options require a user namespace in
order to work as user units (the user manager does not run as root and
thus without a user namespace it is unable to perform mounts).
2022-11-03 23:11:13 +00:00
Max Kellermann
1112d3907a Revert "systemd: add "RuntimeDirectory" directive"
This reverts commit 552c30eae4.

It has caused various problems; for example, MPD wasn't able to write
the pid_file (which was already mitigated by commit a4e4217204).

And apparently, the socket file created in the same directory by
mpd.socket disappears when mpd.service (re)creates the directory.  I
could not reproduce this problem with 247.3, but maybe this is a bug
in older systemd versions?

Until we figure out why this happens, let's remove the
RuntimeDirectory directive.  A future MPD version may be launched as
regular user, not as root, which will eliminate one major problem with
RuntimeDirectory.
2021-11-11 10:16:13 +01:00
Max Kellermann
ce77b148d9 CommandLine: add option --systemd
This way, MPD can reliably detect whether it was started as systemd
service, which is better than checking sd_booted(), which only checks
whether systemd manages all services, but still MPD could be started
manually.
2021-11-05 08:51:49 +01:00
Max Kellermann
552c30eae4 systemd: add "RuntimeDirectory" directive 2021-10-26 08:38:36 +02:00
Max Kellermann
c031f9aa5d systemnd: configure LimitMEMLOCK for io_uring
The io_uring buffer is allocated as memlocked memory, as MPD needs to
be able to lock memory.
2020-06-09 21:09:00 +02:00
Max Kellermann
c89c7f71a2 thread/Util: lower the real-time priority from 50 to 40
On linux-rt, kernel IRQ threads are configured with priority=50, and
this change configures MPD somewhat below that priority, leaving some
room for other programs to be configured in between.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/643
2019-10-09 14:40:02 +02:00
Max Kellermann
fe8621906d systemd: add user socket unit
Copy the system socket unit to the "user" directory.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/530
2019-04-10 16:37:13 +02:00
Max Kellermann
b4fcbdb235 systemd/socket: use %t instead of hard-coding /run
This allows using the file as a user unit, where "%t" maps to
"$XDG_RUNTIME_DIR".

Proposed in https://github.com/MusicPlayerDaemon/MPD/issues/530
2019-04-10 16:34:40 +02:00
Max Kellermann
94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann
a31da51fd9 lib/systemd/Watchdog: implement the systemd watchdog protocol 2018-08-02 11:15:35 +02:00
Max Kellermann
99659e4cf9 Merge tag 'v0.19.21'
release v0.19.21
2016-12-13 11:00:39 +01:00
Max Kellermann
ab332d7b2e systemd: add user unit
The user unit omits the "ProtectKernelModules" setting which fails
with modular kernels:

 Failed at step CAPABILITIES spawning /usr/bin/mpd: Operation not permitted

It is unfortunate that systemd (version 232) is unable to reduce its
own capabilities, because this requires us to split system and user
units.

 https://bugs.musicpd.org/view.php?id=4608
2016-12-13 10:24:10 +01:00
Max Kellermann
53e22b81ef systemd: add "system" sub directory 2016-12-13 10:24:10 +01:00
Max Kellermann
ae7e25ea65 Merge tag 'v0.19.20'
release v0.19.20
2016-12-09 20:18:54 +01:00
Max Kellermann
e3237f057d systemd: more paranoid security settings 2016-12-09 10:41:44 +01:00
Florian Schlichting
54d5d9d1cc systemd: protect /usr when running under systemd 2016-12-09 10:41:44 +01:00
Clément B
31d9aebf0b systemd: also disable mpd.socket when disabling mpd.service
e.g. when running 'update-rc.d mpd disable'
2016-12-09 10:41:43 +01:00
Max Kellermann
c85ba73371 systemd: set Type=notify
Tell systemd that MPD is going to notify it when initialization is
done.
2016-02-26 16:14:06 +01:00
Max Kellermann
9bc0fada5c Merge tag 'v0.19.12'
release v0.19.12
2015-12-15 22:05:21 +01:00
Christian Hesse
77aaf1baee fix LimitRTTIME in systemd unit file
systemd does not understand LimitRTTIME=-1. For no limit we have to use
the string 'infinity' (see systemd.exec(5)).

Signed-off-by: Christian Hesse <mail@eworm.de>
2015-12-15 21:17:04 +01:00
Max Kellermann
94f850a588 Merge tag 'v0.19.11' 2015-10-27 11:05:47 +01:00
Max Kellermann
0cbfb610f2 systemd: remove obsolete ControlGroup settings
This systemd feature has been removed a while ago without replacement,
and it turns out that systemd developers suggest not using control
groups at all to assign real-time privileges.  Therfore, a replacement
feature will not be implement in future systemd releases, and we can
really remove those lines completely.

See http://bugs.musicpd.org/view.php?id=4413
2015-10-27 10:36:23 +01:00
Florian Schlichting
5d13c13821 systemd: protect /usr when running under systemd 2015-08-11 19:00:21 +02:00
Clément B
21ef656e24 systemd: also disable mpd.socket when disabling mpd.service
e.g. when running 'update-rc.d mpd disable'
2015-08-11 18:58:34 +02:00
Wieland Hoffmann
95ebd57b25 mpd.service: Set the Documentation option
This makes references to mpd(1) and mpd(5) appear in systemd status output.
2015-08-06 22:03:29 +02:00
Max Kellermann
9e02b13ab3 systemd: add socket activation files 2014-02-12 21:22:36 +01:00
Max Kellermann
5a486a940c systemd: assign real-time budget 2014-02-12 21:00:53 +01:00
Max Kellermann
0ab66db7b9 move systemd unit to directory systemd/ 2014-01-27 08:55:42 +01:00