diff --git a/docs/jukebox.rst b/docs/jukebox.rst index 3066b4b..f241730 100644 --- a/docs/jukebox.rst +++ b/docs/jukebox.rst @@ -2,17 +2,16 @@ Jukebox mode ============ The jukebox mode allow playing audio files on the hardware of the machine -running *Supysonic*, using regular clients that support it as a remote control. +running Supysonic, using regular clients that support it as a remote control. -The daemon must be running in order to be able to use the jukebox mode. So be -sure to start the ``supysonic-daemon`` command and keep it running. A basic -*systemd* service file can be found at the root of the project folder. +:doc:`setup/daemon` must be running in order to be able to use the jukebox mode. +So be sure to start the :doc:`man/supysonic-daemon` command and keep it running. Setting the player program -------------------------- -Jukebox mode in *Supysonic* works through the use of third-party command-line -programs. *Supysonic* isn't bundled with such programs, and you are left to +Jukebox mode in Supysonic works through the use of third-party command-line +programs. Supysonic isn't bundled with such programs, and you are left to choose which one you want to use. The chosen program should be able to play a single audio file from a path specified on its command-line. diff --git a/docs/setup/daemon.rst b/docs/setup/daemon.rst new file mode 100644 index 0000000..30d6003 --- /dev/null +++ b/docs/setup/daemon.rst @@ -0,0 +1,59 @@ +The daemon +========== + +Supysonic comes with an optional daemon service that currently provides the +following features: + +- background scans +- library changes detection +- jukebox mode + +Background scans +---------------- + +First of all, the daemon allows running backgrounds scans, meaning you can start +scans from the :doc:`command-line interface <../man/supysonic-cli>` and do +something else while it's scanning (otherwise the scan will block the CLI until +it's done). Background scans also enable the web UI to run scans, while you have +to use the CLI to do so if you don't run the daemon. + +Library watching +---------------- + +Instead of manually running a scan every time your library changes, the daemon +can listen to any library change and update the database accordingly. This +watcher is started along with the daemon but can be disabled to only keep +background scans. Please refer to :ref:`conf-daemon` of the configuration to +enable or disable it. + +Jukebox +------- + +Finally, the daemon acts as a backend for the jukebox mode, allowing to play +audio on the machine running Supysonic. More details on the :doc:`../jukebox` +page. + +Running it +---------- + +The daemon is :doc:`../man/supysonic-daemon`, it is a non-exiting process. +If you want to keep it running in background, either use the old +:command:`nohup` or :command:`screen` methods, or start it as a systemd unit. + +Below is a basic service file to load it through systemd. Modify it to match +your installation and save it as +:file:`/etc/systemd/system/supysonic-daemon.service`. + +.. code-block:: ini + + [Unit] + Description=Supysonic Daemon + + [Service] + User=someuser + Group=somegroup + WorkingDirectory=/home/supysonic + ExecStart=/usr/bin/python3 -m supysonic.daemon + + [Install] + WantedBy=multi-user.target diff --git a/docs/setup/index.rst b/docs/setup/index.rst index 4cb79c9..a2a75bc 100644 --- a/docs/setup/index.rst +++ b/docs/setup/index.rst @@ -1,13 +1,14 @@ Supysonic setup =============== -This guide details the required steps to get a *Supysonic* instance ready to +This guide details the required steps to get a Supysonic instance ready to start serving your music. .. toctree:: - :maxdepth: 2 + :maxdepth: 2 - install - database - configuration - deploying/index + install + database + configuration + deploying/index + daemon