Commit c565943d authored by Max Kellermann's avatar Max Kellermann Committed by Alexey Shabalin

systemd: add socket activation files

Conflicts: NEWS
parent 411f5c87
...@@ -1028,6 +1028,7 @@ FILTER_LIBS = \ ...@@ -1028,6 +1028,7 @@ FILTER_LIBS = \
if HAVE_SYSTEMD if HAVE_SYSTEMD
systemdsystemunit_DATA = \ systemdsystemunit_DATA = \
systemd/mpd.socket \
systemd/mpd.service systemd/mpd.service
endif endif
......
...@@ -106,29 +106,18 @@ cd mpd-version</programlisting> ...@@ -106,29 +106,18 @@ cd mpd-version</programlisting>
<para> <para>
Using <filename>systemd</filename>, you can launch Using <filename>systemd</filename>, you can launch
<filename>mpd</filename> on demand when the first client <filename>mpd</filename> on demand when the first client
attempts to connect. Create two files in attempts to connect.
<filename>/etc/systemd/system/</filename>; first
<filename>mpd.socket</filename>:
</para> </para>
<programlisting>[Socket]
ListenStream=/run/mpd.socket
ListenStream=6600
[Install]
WantedBy=sockets.target</programlisting>
<para> <para>
Now create <filename>mpd.service</filename>: MPD comes with two <filename>systemd</filename> unit files: a
"service" unit and a "socket" unit. These will only be
installed when MPD was configured with
<parameter>--with-systemdsystemunitdir=/lib/systemd</parameter>.
</para> </para>
<programlisting>[Unit]
Description=Music Player Daemon
After=sound.target
[Service]
ExecStart=/usr/bin/mpd --stdout --no-daemon</programlisting>
<para> <para>
Start the socket: To enable socket activation, type:
</para> </para>
<programlisting>systemctl enable mpd.socket <programlisting>systemctl enable mpd.socket
......
[Socket]
ListenStream=/run/mpd/socket
ListenStream=6600
Backlog=5
KeepAlive=true
PassCredentials=true
[Install]
WantedBy=sockets.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment