Mpd 4.4.1 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.

-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 first link. 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 first link. If the link is already in a closed state, this signal has no effect.


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