You are not logged in.

#1 2009-02-03 17:36:44

publius
Member
Registered: 2008-10-18
Posts: 15

MPD broken after system upgrade

On both my computers, with unique configurations, after running a system-wide upgrade via pacman -Syu, MPD is broken. When I try to start it with < sudo mpd start >, it returns:

** ERROR **: problems opening file start for reading: No such file or directory

aborting...
Aborted

Otherwise, if I try starting it with < sudo /etc/rc.d/mpd start >, it returns:

/etc/rc.d/mpd: line 6:  3074 Aborted  usr/bin/mpd /etc/mpd.conf >&/dev

When I comment out the corresponding line in the initialization script, MPD returns success but, in reality, it still does not connect and ncmpc (my mp3 player) cannot see it. None of my settings in mpd.conf have changed since upgrading the system. All my files and permissions are still intact.

Finally, the system update did install a new version of MPD with a slightly different mpd.conf syntax, but even after configuring it to exactly my old settings, still no go.

I'd appreciate any insight.

yikes

Offline

#2 2009-02-03 17:38:38

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: MPD broken after system upgrade

Please check your mpd init script actually looks like this:

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Starting Music Player Daemon"
    /usr/bin/mpd /etc/mpd.conf &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon mpd
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping Music Player Daemon"
    /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon mpd
      stat_done
    fi
    ;;
  create-db)
    stat_busy "Creating mpd's database ..."
        logpath="/var/log/mpd/mpd.db-creation"
    /usr/bin/mpd --create-db /etc/mpd.conf > $logpath \
        && stat_busy "Output written to $logpath"
              stat_done
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart|create-db}"
esac
exit 0

He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2009-02-03 17:56:37

publius
Member
Registered: 2008-10-18
Posts: 15

Re: MPD broken after system upgrade

Yours and mine are identical.

Here is my mpd.conf file: http://pastebin.com/m2c451843

Here are the contents of my .mpd directory:

drwxr-xr-x 2 daniel users   4096 2008-10-27 00:53 playlists/
-rw-r--r-- 1 daniel users 287158 2009-02-03 09:35 mpd.db
-rw-r--r-- 1 daniel users  11875 2009-02-02 22:11 mpd.error
-rw-r--r-- 1 daniel users  76499 2009-01-31 20:14 mpd.log
-rw-r--r-- 1 daniel users      0 2008-10-27 00:53 mpd.pid
-rw-r--r-- 1 daniel users      0 2008-10-27 00:53 mpdstate

Last edited by publius (2009-02-03 17:57:07)

Offline

#4 2009-02-03 18:13:43

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: MPD broken after system upgrade

Start it with strace, maybe you can see what file exactly it is trying to open.

Offline

#5 2009-02-03 18:22:42

publius
Member
Registered: 2008-10-18
Posts: 15

Re: MPD broken after system upgrade

Here's a link to the strace output: http://pastebin.com/m2a235fa1

I can see that MPD cannot open several files along the way, but I am not sure whether this is normally the case or not (for my machine). This is the first time I have used strace, so I am not trained at deciphering the errors. I have to run now, but later tonight I will take another look with a steadier eye. But if you can see something glaringly wrong, do tell!

Offline

#6 2009-02-03 18:59:21

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: MPD broken after system upgrade

Oh, it actually tries to open a file named "start".
line 339: open("start", O_RDONLY) = -1 ENOENT (No such file or directory)

Now I see what you posted too:
sudo mpd start should be sudo mpd /etc/mpd.conf

And the other problem as Rasi pointed out is the rather weird line returned from your rc.d file. Here are the two next to each other:

usr/bin/mpd /etc/mpd.conf >&/dev          # your rc.d/mpd
/usr/bin/mpd /etc/mpd.conf &> /dev/null    # good rc.d/mpd

Offline

#7 2009-02-03 19:15:49

joephantom
Member
From: Latinoamérica
Registered: 2008-01-09
Posts: 94
Website

Re: MPD broken after system upgrade

publius wrote:

On both my computers, with unique configurations, after running a system-wide upgrade via pacman -Syu, MPD is broken. When I try to start it with < sudo mpd start >, it returns:

** ERROR **: problems opening file start for reading: No such file or directory

aborting...
Aborted

Otherwise, if I try starting it with < sudo /etc/rc.d/mpd start >, it returns:

/etc/rc.d/mpd: line 6:  3074 Aborted  usr/bin/mpd /etc/mpd.conf >&/dev

I think have the same problem in my house (I'm not wright now there). Tomorrow, when I return home, I will take a look at this.

Last edited by joephantom (2009-02-03 19:22:57)


By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin

Offline

#8 2009-02-03 19:44:52

publius
Member
Registered: 2008-10-18
Posts: 15

Re: MPD broken after system upgrade

Procyon wrote:

Oh, it actually tries to open a file named "start".
line 339: open("start", O_RDONLY) = -1 ENOENT (No such file or directory)

Now I see what you posted too:
sudo mpd start should be sudo mpd /etc/mpd.conf

And the other problem as Rasi pointed out is the rather weird line returned from your rc.d file. Here are the two next to each other:

usr/bin/mpd /etc/mpd.conf >&/dev          # your rc.d/mpd
/usr/bin/mpd /etc/mpd.conf &> /dev/null    # good rc.d/mpd

Oh! I can see now that the there is an inverted "redirect" sign in rc.d/mpd's traceback! Thanks for pointing that out to me. I just double-checked, and there was no actual instance of an inverted "&>"  anywhere in the file. (Evidence: http://pastebin.com/d532816d5)

That's weird.

Last edited by publius (2009-02-03 19:49:00)

Offline

#9 2009-02-03 19:56:10

publius
Member
Registered: 2008-10-18
Posts: 15

Re: MPD broken after system upgrade

I just tried doing what you suggested and ran:

sudo mpd /etc/mpd.conf

That returned:

No "audio_output" defined in config file
Attempt to detect audio output device
Attempting to detect a alsa audio device
Successfully detected a alsa audio device
could not open pid_file "/var/run/mpd/mpd.pid" (at line 39) for writing: Permission denied
Aborted

Which seems to say the problem is with opening mpd.pid. Hmmm... Let me investigate.

Offline

#10 2009-02-03 20:08:26

publius
Member
Registered: 2008-10-18
Posts: 15

Re: MPD broken after system upgrade

Case closed smile At first, I think the problem arose because I did not immediately install the new mpd.conf file. Then, because I forgot to uncomment the lines refering to the location of mpd.pid, the daemon would not start up. The "minor syntax" changes mentioned upon upgrading MPD seemed to suggest that the syntax was actually different, but it seems like they mostly just moved things around and added two new options. Had the file paths been listed closer together, as in the previous version, I think I would have caught myself.

Thanks for your help. Hopefully I can return it sometime!

Last edited by publius (2009-02-03 20:09:11)

Offline

#11 2009-02-05 17:08:30

joephantom
Member
From: Latinoamérica
Registered: 2008-01-09
Posts: 94
Website

Re: MPD broken after system upgrade

publius wrote:

Oh! I can see now that the there is an inverted "redirect" sign in rc.d/mpd's traceback! Thanks for pointing that out to me. I just double-checked, and there was no actual instance of an inverted "&>"  anywhere in the file. (Evidence: http://pastebin.com/d532816d5)

:: Stopping Music Player Daemon                                                                                                                                                                                                                                                 [DONE] 
:: Starting Music Player Daemon                                                                                                                                                                                                                                                 [BUSY] /etc/rc.d/mpd: line 6:  5043 Aborted                 /usr/bin/mpd /etc/mpd.conf >&/dev/null
                                                                                                                                                                                                                                                                                [FAIL]

but in "/etc/rc.d/mpd" there's no & after >:

/usr/bin/mpd /etc/mpd.conf &> /dev/null

Strange...

And when I run:

sudo mpd /etc/mpd.conf

I get:

binding to address for 127.0.0.1
unable to bind port 6600: Address already in use
maybe MPD is still running?
Aborted

Even thought there's no mpd running...

I've changed the port to 6601 for testing. After changing it, mpd start, but just after connecting to mpd server with a mpd client (sonata, ncmpc) the client loose the connection with the server.

¿Ideas?


By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin

Offline

#12 2009-02-17 08:28:54

MartinB
Member
Registered: 2008-09-06
Posts: 3

Re: MPD broken after system upgrade

joephantom wrote:

but in "/etc/rc.d/mpd" there's no & after >:

/usr/bin/mpd /etc/mpd.conf &> /dev/null

Strange...

That's not strange at all: both symbols >& and &> do the same job (it's syntactic sugar).

Btw, today I have the similar problem - but it's strange since I upgraded mpd two weeks ago. Mpd fails to start at boot time but unlike you I am able to start it manually any time later without any problems or error messages. So I deleted @ sign at mpd in rc.conf and changed /etc/rc.d/mpd slightly:

 /usr/bin/mpd /etc/mpd.conf #&> /dev/null

And now it seems that my network interface is not initialized when mpd tried to start, see:

:: Starting Music Player Daemon                                                            [BUSY]
can't lookup host "127.0.0.1" at line 51: Address family for hostname not supported
/etc/rc.d/mpd: line 6:  5951 Aborted                 /usr/bin/mpd /etc/mpd.conf
                                                                                                           [FAIL]

You probably don't have the same problem but this method probably tell you more.

Offline

#13 2009-02-19 00:06:13

amuchamu
Member
Registered: 2008-03-17
Posts: 7

Re: MPD broken after system upgrade

Hi, I'm a new mpd user, whit the same problem. I've comment out the bind_to_address and port lines from my /etc/mpd.conf and now it starts at boot time.

Offline

#14 2009-06-04 19:28:17

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: MPD broken after system upgrade

That fixed it! 

Nice job amuchamu, wiki updated.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#15 2009-06-13 22:11:21

SomeGuyDude
Member
Registered: 2008-10-09
Posts: 271

Re: MPD broken after system upgrade

Nothing's working for me. And mine's a little... odd:

[crew@myhost ~]$ sudo /etc/rc.d/mpd start
:: Starting Music Player Daemon                                               [DONE] 
[crew@myhost ~]$ sudo /etc/rc.d/mpd stop
:: Stopping Music Player Daemon                                               [BUSY] /etc/rc.d/mpd: line 6:  5066 Aborted                 /usr/bin/mpd --kill /etc/mpd.conf >&/dev/null
                                                                              [FAIL] 
[crew@myhost ~]$

It dies at STOP, but not START?


And in the midst of such perfection,
I can't help but feel diseased.

Offline

#16 2009-06-23 21:39:42

calle
Member
From: Germany
Registered: 2008-11-14
Posts: 45

Re: MPD broken after system upgrade

hej someguydude,

if you use the directories under /var/*/mpd for playlists, database, logs etc (which is the default setup) make sure you have created the user mpd and made him the owner of the respective directories.
eventually do a

sudo chown -hR /var/lib/mpd
sudo chown -hR /var/log/mpd
sudo chown -hR /var/run/mpd

that fixed it for me.

good luck

Offline

#17 2009-10-05 18:20:58

canuckkat
Member
Registered: 2009-08-28
Posts: 44

Re: MPD broken after system upgrade

I'm getting what Gen2ly is getting

:: Starting Music Player Daemon                                                                        [BUSY]
/etc/rc.d/mpd: line 6: 27590 Aborted /usr/bin/mpd /etc/mpd.conf &>/dev/null                            [FAIL]

But amuchamu's fix didn't work cuz my bind_to_address and port lines are already commented out.

Here's my mpd.conf: http://pastebin.ca/1595184

Here's my rc.d/mpd: http://pastebin.ca/1595175

Offline

#18 2009-10-05 22:34:06

Raffles10
Member
From: London, UK
Registered: 2009-05-09
Posts: 115

Re: MPD broken after system upgrade

Can I ask why you guys are all starting mpd as root ?

OK I've just checked the wiki, now I know.

Keeps the setup in /var and uses "mpd" as default user instead of cluttering up ~/. This is the way the arch package is installed.

I have to say that his is a very long winded and unnecessarily complicated way of setting up mpd.  Cluttering up ~/. ?. Is adding one directory and one file cluttering up ~/. ?. The alternative set up method is much better.

I've found the simple way to set up mpd is to put everything in ~/.mpd/ & ~/.mpdconf & set 'user' to your own username. I've not experienced the problems you're discussing but I am using the latest version from:

http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki

as I found the one in extra to have the stuttering playback problem that was fixed in mpd-0.15.3.

Arch is supposed to be 'KISS' isn't it ? I don't think the fist set of instructions on the mpd wiki is a very 'KISS' way of setting up mpd. The alternative method is preferable especially for those new to mpd.

Offline

#19 2009-10-06 02:10:22

canuckkat
Member
Registered: 2009-08-28
Posts: 44

Re: MPD broken after system upgrade

OK, after making mpd run NOT as root, it works fine with no problems.

I put all the files are in ~/.mpd/ and copied mpd.conf.example to ~/.mpd/config, edited it to set all the accessed files in ~/.mpd and set the music directory.

Then I went

mpd --create-db ~/.mpd/config

^_^

P.S. I can post my config file if anyone wants.

Last edited by canuckkat (2009-10-06 02:35:11)

Offline

#20 2009-10-06 06:06:04

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: MPD broken after system upgrade

canuckkat wrote:

OK, after making mpd run NOT as root, it works fine with no problems.

I put all the files are in ~/.mpd/ and copied mpd.conf.example to ~/.mpd/config, edited it to set all the accessed files in ~/.mpd and set the music directory.

Then I went

mpd --create-db ~/.mpd/config

^_^

P.S. I can post my config file if anyone wants.

mpd --create-db is abandonded btw. dont use it! Use your client instead to update your library.

As a sidenote: mpd-git has inotify support, means it automatically sees changes in your library


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#21 2009-10-06 21:46:03

Raffles10
Member
From: London, UK
Registered: 2009-05-09
Posts: 115

Re: MPD broken after system upgrade

Rasi wrote:

...mpd --create-db is abandonded btw. dont use it!...

Who says it's abandoned ? Any particular reason for it to be abandoned ? MPD Wikia doesn't say it's abandoned.

Seriously I would recommend anyone having difficulty installing or setting up mpd to refer to the MPD Wikia as much of the stuff I've read here and in the Arch wiki makes little or no sense.

I'm sure there were good reasons for the Arch mpd wiki to recommend what it does but I can't think what they were.

Offline

Board footer

Powered by FluxBB