aboutsummaryrefslogtreecommitdiffstats
path: root/doc/user.xml
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-13 20:48:51 +0100
committerMax Kellermann <max@duempel.org>2012-02-13 21:32:42 +0100
commit7338b16c180a879745ecf6dcd6a7d490081dbb01 (patch)
tree9fe1882d415d5bbb3693f94f2b7150f0b675f2d4 /doc/user.xml
parentf5294414004c258236a9d31ae3d3ee00ccb26717 (diff)
downloadmpd-7338b16c180a879745ecf6dcd6a7d490081dbb01.tar.gz
mpd-7338b16c180a879745ecf6dcd6a7d490081dbb01.tar.xz
mpd-7338b16c180a879745ecf6dcd6a7d490081dbb01.zip
listen: implement systemd socket activation
Diffstat (limited to 'doc/user.xml')
-rw-r--r--doc/user.xml41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/user.xml b/doc/user.xml
index d0db21ef7..427e561c5 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -99,6 +99,47 @@ cd mpd-version</programlisting>
<programlisting>make install</programlisting>
</section>
+
+ <section>
+ <title><filename>systemd</filename> socket activation</title>
+
+ <para>
+ Using <filename>systemd</filename>, you can launch
+ <filename>mpd</filename> on demand when the first client
+ attempts to connect. Create two files in
+ <filename>/etc/systemd/system/</filename>; first
+ <filename>mpd.socket</filename>:
+ </para>
+
+ <programlisting>[Socket]
+ListenStream=/run/mpd.socket
+ListenStream=6600
+[Install]
+WantedBy=sockets.target</programlisting>
+
+ <para>
+ Now create <filename>mpd.service</filename>:
+ </para>
+
+ <programlisting>[Unit]
+Description=Music Player Daemon
+After=sound.target
+[Service]
+ExecStart=/usr/bin/mpd --stdout --no-daemon</programlisting>
+
+ <para>
+ Start the socket:
+ </para>
+
+ <programlisting>systemctl enable mpd.socket
+systemctl start mpd.socket</programlisting>
+
+ <para>
+ In this configuration, <filename>mpd</filename> will ignore
+ the <varname>bind_to_address</varname> and
+ <varname>port</varname> settings.
+ </para>
+ </section>
</chapter>
<chapter>