Skip to content

Commit

Permalink
docs: Repurpose Debian pkg page as a service page
Browse files Browse the repository at this point in the history
Fixes #1398
  • Loading branch information
jodal committed Jan 18, 2016
1 parent e69ea22 commit 123614a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 106 deletions.
87 changes: 0 additions & 87 deletions docs/debian.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ announcements related to Mopidy and Mopidy extensions.
installation/index
config
running
service
troubleshooting
debian


.. _ext:
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/debian.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ and armhf (compatible with Raspberry Pi 1 and 2).
sudo apt-get update
sudo apt-get install mopidy

#. Before continuing, make sure you've read the :ref:`debian` section to learn
#. Before continuing, make sure you've read the :ref:`service` section to learn
about the differences between running Mopidy as a system service and
manually as your own system user.

Expand Down
21 changes: 4 additions & 17 deletions docs/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,8 @@ using ``pkill``::
pkill mopidy


Init scripts
============

- The ``mopidy`` package at `apt.mopidy.com <http://apt.mopidy.com/>`__ comes
with an `sysvinit init script
<https://github.com/mopidy/mopidy/blob/debian/debian/mopidy.init>`_. For
more details, see the :ref:`debian` section of the docs.

- The ``mopidy`` package in `Arch Linux
<https://www.archlinux.org/packages/community/any/mopidy/>`__ comes with a systemd init
script.

- A blog post by Benjamin Guillet explains how to `Daemonize Mopidy and Launch
It at Login on OS X
<http://www.benjaminguillet.com/blog/2013/08/16/launch-mopidy-at-login-on-os-x/>`_.
Running as a service
====================

- Issue :issue:`266` contains a bunch of init scripts for Mopidy, including
Upstart init scripts.
Once you're done exploring Mopidy and want to run it as a proper service, check
out :ref:`service`.
92 changes: 92 additions & 0 deletions docs/service.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
.. _service:

********************
Running as a service
********************

If you want to run Mopidy as a service using either an init script or a systemd
service, there's a few differences from running Mopidy as your own user you'll
want to know about. The following applies to Debian, Ubuntu, Raspbian, and
Arch. Hopefully, other distributions packaging Mopidy will make sure this works
the same way on their distribution.


Configuration
=============

All configuration is in :file:`/etc/mopidy`, not in your user's home directory.

The main configuration file is :file:`/etc/mopidy/mopidy.conf`. If there are
more than one configuration file, this is the configuration file with the
highest priority, so it can override configs from all other config files.
Thus, you can do all your changes in this file.

This comment has been minimized.

Copy link
@trygveaa

trygveaa Jan 18, 2016

Member

This seems a bit inaccurate. As far as I can see from the service file, the only configuration read in /etc/mopidy is /etc/mopidy/mopidy.conf, while there may be more in /usr/share/mopidy/conf.d.



mopidy User
===========

The init script runs Mopidy as the ``mopidy`` user, which is automatically

This comment has been minimized.

Copy link
@trygveaa

trygveaa Jan 18, 2016

Member

Replace init script with service?

created when you install the Mopidy package. The ``mopidy`` user will need read
access to any local music you want Mopidy to play.


Subcommands
===========

To run Mopidy subcommands with the same user and config files as the service
uses, you can use ``sudo mopidyctl <subcommand>``. In other words, where you'll
usually run::

mopidy config

You should instead run the following to inspect the service's configuration::

sudo mopidyctl config

The same applies to scanning your local music collection. Where you'll normally
run::

mopidy local scan

You should instead run::

sudo mopidyctl local scan


Service management with systemd
===============================

On modern systems using systemd you can enable the Mopidy service by running::

sudo systemctl enable mopidy

This will make Mopidy start when the system boots.

Mopidy is started, stopped, and restarted just like any other systemd service::

sudo systemctl start mopidy
sudo systemctl stop mopidy
sudo systemctl restart mopidy

You can check if Mopidy is currently running as a service by running::

sudo systemctl status mopidy


Service management on Debian
============================

On Debian systems (both those using systemd and not) you can enable the Mopidy
service by running::

sudo dpkg-reconfigure mopidy

Mopidy can be started, stopped, and restarted using the ``service`` command::

sudo service mopidy start
sudo service mopidy stop
sudo service mopidy restart

You can check if Mopidy is currently running as a service by running::

sudo service mopidy status

0 comments on commit 123614a

Please sign in to comment.