PDA

View Full Version : [ubuntu] MPD won't start on startup



denarced
April 21st, 2010, 12:46 PM
I've added mpd to System->Preferences->Startup Applications several times and it always just disappears and of course isn't started.
I have used both mpd and /usr/bin/mpd as the command.
I have done a log search as follows:

sudo find /var/log -type f -mtime -5 -exec grep -i -e 'mpd' '{}' \+
and nothing significant was found, e.g. an error message indicating that the mpd startup command was removed.

Anyone know a solution ?

Much thanks in advance.

Brandon Williams
April 22nd, 2010, 06:55 PM
Post the contents of your ~/.config/autostart/XXX.desktop file, where XXX is the name used to represent mpd in your Startup Applications screen. If necessary, 'grep mpd ~/.config/autostart/*.desktop' to figure out which file it is.

Also, take a look at ~/.xsession-errors to see if there are any useful log messages there (post the content if you're not sure).

And finally, take a look at the mpd log file to see if there are any useful log messages there. By default, the log file is /var/log/mpd/mpd.log if you run mpd at system startup. Presumably you run mpd as a regular user (if not, why add it to 'Startup Applications'?), so your log file will not be in the default location.

denarced
April 22nd, 2010, 07:35 PM
So,
naturally I couldn't post the content's of the mpd.desktop
file since it didn't exist. Found nothing in .xsession-errors
and nothing at .mpd/mpd.log either. xsession-log wasn't long
and I can say for sure that there was nothing on this issue
but mpd.log is huge since it's set on verbose.

So I thought, let's re-create the problem: I added the startup
again and checked the error logs. Nothing
But now it started ok. That's the damnest thing, it got fixed
all on it's own. That's just not possible. Either I ****ed up
on the first attempts or the problem is intermittent. The for-
mer is more likely but I will post the error if the problem
occurs again.

dannymichel
April 29th, 2010, 02:15 AM
[edit] sorry, fixed

bodinux
June 13th, 2010, 09:56 AM
May I suggest that you edit /etc/default/mpd to start mpd automatically with the configuration file of your choice ?

jpkotta
June 13th, 2010, 05:28 PM
There are 2 common ways to run mpd. The way that is set up by default is system wide, where mpd looks at /etc/mpd.conf and is started by /etc/init.d/mpd (and automatically at boot by links in /etc/rc?.d/). The other way is to start it as a normal user in your ~/.xsession or your window manager or whatever. Then it will get its config from ~/.mpdconf. Either way, you have to tell it to start in some way (either the rc?.d links or something on login) and you have to edit the mpd.conf. I usually run it as a normal user, and I've found that there can be interactions if a system-wide mpd is also running, so I always delete the mpd symlinks in rc?.d/.

engmex
December 15th, 2010, 04:34 PM
I have a similar problem i.e. mpd is not starting as a service at boot. I can't understand why running the sripts are in /etc/init.d and /etc/init the symbolic links are in /etc/rc*.d. If I run the script from intit.d or rc*.d at the command line it starts fine. Any suggestions?

jpkotta
December 17th, 2010, 01:48 AM
Have a look at errors.log and mpd.log in /var/log/mpd/.

engmex
December 17th, 2010, 11:04 PM
Have a look at errors.log and mpd.log in /var/log/mpd/.
Thanks for the reply! I already checked those files there is no message.

engmex
December 18th, 2010, 05:07 PM
I've found the problem, but not the solution! The problem is that I want mpd to listen to connections on my local network, but when the mpd script is called by upstart the network has not come up yet. I've tried changing the mpd script to K99, but that doesn't help because it is still called before the network has time to assign the IP address. Any suggestions?
Additionally I have another question. One of the reasons that it took me so long to find the problem is that I'm not getting any error messages. I understand that the init scripts are now called by upstart, but where are they logged to. I can't find any messages in any log file anywhere.