Invoking mpd

Mpd 3.18 User Manual : Running Mpd : Invoking mpd
Previous: Running Mpd
Next: Configuration file format

## 3.1. Invoking mpd

Mpd is invoked by first setting up your configuration files, and then running

> ``mpd [ options ] [ configuration ]``

If `configuration` is supplied, then mpd looks in `mpd.conf` for a matching label, and runs the corresponding commands (up to the first blank line). If `configuration` is not supplied, mpd looks for the configuration named `default`. If the configuration is not found, no commands are executed from `mpd.conf`.

Mpd can either be run in interactive mode or in the background as a daemon. In interactive mode mpd accepts commands typed at the console.

Mpd understands the following command line options. Each option has a short, single character form, as well as an equivalent long form.

`-b --background`

  Run as a background daemon.

`-a --console-address ip-address`
`-c --console-port port`

  With either of these options, mpd will listen for and accept TCP connections on the given IP address and port. Once connected, you can enter commands just as if they were typed in interactive mode. Note that this is a potential security hole, as any user on the system can connect. Mpd allows you to require a login and password if so desired, but beware: by default, no login is required.

  The default IP address is `0.0.0.0` (i.e., listen on all interfaces) and the default port is 5005.

`-d --directory dir`

  This option allows you to specify a different directory for the mpd configuration files other than the default `/usr/local/etc/mpd`.

`-f --file filename`

  Specify an initial configuration file other than the default, `mpd.conf`.

`-p --pidfile filename`

  Mpd will open and lock `filename` and write its process ID before starting. If another mpd process is already running, mpd will not start. The default is `/var/run/mpd.pid`.

`-k --kill`

  With this option, pd will attempt to kill any existing mpd process before beginning execution. The previous process must have written its process ID in the PID file `/var/run/mpd.pid` (or the file you specify with the `--pidfile` option).

`-s --syslog-ident ident`

  Mpd normally logs via `syslog(3)` with the identifier `mpd`. This option allows you to change that identifier.

`-v --version`

  Displays the version number of mpd and exits.

`-h --help`

  Displays a usage message and exits.

Mpd responds to the following signals while it is running:

SIGTERM

  Attempt to gracefully shut down all active connections and exit.

SIGUSR1

  This signal causes mpd to initiate a connection with the currently active bundle. If mpd is already attempting to connect, this signal has no effect.

SIGUSR2

  This signal has the opposite effect, namely, it causes mpd to close the currently active bundle. If the bundle is already in a closed state, this signal has no effect.

Mpd 3.18 User Manual : Running Mpd : Invoking mpd
Previous: Running Mpd
Next: Configuration file format