diff options
Diffstat (limited to 'doc/user.xml')
-rw-r--r-- | doc/user.xml | 41 |
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> |