mpd unable to create database

Bug #902485 reported by René F. Franke
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux Mint
Fix Released
Undecided
Unassigned
mpd (Debian)
Fix Released
Unknown
mpd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Version: Linux Mint 12 (Gnome 64-bit)

After installing mpd via apt-get, the service refuses to create the needed database. This behaviour is easily reproducable. Especially when having a look at /etc/init.d/mpd, which ends up with:

 case "$1" in
    start)
        mpd_start
        ;;
    stop)
        mpd_stop
        ;;
    status)
     status_of_proc -p $PIDFILE $DAEMON $NAME
 ;;
    restart|force-reload)
        mpd_stop
        mpd_start
        ;;
    force-start)
        mpd_start
        ;;
    force-restart)
        mpd_stop
        mpd_start
        ;;
    force-reload)
 mpd_stop
 mpd_start
 ;;
    *)
        echo "Usage: $0 {start|start-create-db|stop|restart|force-reload}"
        exit 2
        ;;

So the parameter "start-create-db" will never be caught. Neither is there any rountine within the mpd_start-function concerning the database.

I fixed the problem so far by using /etc/init.d/mpd as provided by Debian 6.0.3:

"
[...]
mpd_start () {
    if [ "$START_MPD" != "true" ]; then
        log_action_msg "Not starting MPD: disabled by /etc/default/$NAME".
        exit 0
    fi

    log_daemon_msg "Starting $DESC" "$NAME"

    if [ -z "$PIDFILE" -o -z "$DBFILE" ]; then
        log_failure_msg \
            "$MPDCONF must have db_file and pid_file set; cannot start daemon."
        exit 1
    fi

    PIDDIR=$(dirname "$PIDFILE")
    if [ ! -d "$PIDDIR" ]; then
        mkdir -m 0755 $PIDDIR
        chown mpd:audio $PIDDIR
    fi

    if [ "$FORCE_CREATE_DB" -o ! -f "$DBFILE" ]; then
        log_warning_msg "creating $DBFILE... "
        $DAEMON --create-db "$MPDCONF" > /dev/null 2>&1
    fi

    start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" \
        --exec "$DAEMON" -- $MPD_OPTS "$MPDCONF"
    log_end_msg $?
}

[...]
case "$1" in
    start)
        mpd_start
        ;;
    stop)
        mpd_stop
        ;;
    restart|force-reload)
        mpd_stop
        mpd_start
        ;;
    force-start|start-create-db)
        FORCE_CREATE_DB=1
        mpd_start
        ;;
    force-restart)
        FORCE_CREATE_DB=1
        mpd_stop
        mpd_start
[...]
"

Kind regards

René Franke
Wiesbaden, Germany

Tags: patch

Related branches

Revision history for this message
Ronny Cardona (rcart) wrote :

Hello René.

You should take a look at the changelog in 0.16.2-1 version: https://launchpad.net/ubuntu/+source/mpd/0.16.2-1ubuntu1
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Revision history for this message
Benoît Knecht (benoit-knecht) wrote :

Since the functionality has been removed from the init script, the Usage string should be updated to reflect this (see attached patch).

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Remove_start-create-db_from_mpd_init_script_usage_string.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Ronny Cardona (rcart) wrote :

Benoît Knecht, I'll try to work on a branch to correct it, and if needed, forward it to upstream.

Ronny Cardona (rcart)
Changed in mpd (Ubuntu):
assignee: nobody → Ronny Cardona (rcart)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mpd - 0.16.5-1ubuntu3

---------------
mpd (0.16.5-1ubuntu3) precise; urgency=low

  * debian/mpd.init.d:
    - Removed start-create-db option from Usage string. (LP: #902485)
 -- Ronny Cardona <email address hidden> Sat, 03 Mar 2012 16:02:12 -0800

Changed in mpd (Ubuntu):
status: New → Fix Released
Ronny Cardona (rcart)
Changed in mpd (Ubuntu):
assignee: Ronny Cardona (rcart) → nobody
Changed in mpd (Debian):
status: Unknown → New
Changed in mpd (Debian):
status: New → Fix Committed
Changed in mpd (Debian):
status: Fix Committed → Fix Released
Changed in linuxmint:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.