You are not logged in.

#1 2014-09-26 02:10:36

geo909
Member
Registered: 2008-09-07
Posts: 309

Cannot start mpd as systemd service

Hi all,

I have installed mpd. If I run

mpd

from a terminal, then everything is normal; I can open
a client and use mpd. However, if I try to start it as a systemd service I get errors. That is, once I do

sudo systemctl enable mpd

and reboot, then

jorge@flamingo:~$ systemctl status mpd
● mpd.service - Music Player Daemon
   Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
   Active: failed (Result: signal) since Thu 2014-09-25 22:01:48 EDT; 2min 20s ago
 Main PID: 1647 (code=killed, signal=ABRT)

Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned erro...rectory
Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
Sep 25 22:01:48 flamingo mpd[1647]: alsa_output: Error opening default ALSA device: No such file or directory
Sep 25 22:01:48 flamingo mpd[1647]: output: Attempting to detect a oss audio device
Sep 25 22:01:48 flamingo mpd[1647]: oss_output: Error opening OSS device "/dev/dsp": No such file or directory
Sep 25 22:01:48 flamingo mpd[1647]: oss_output: Error opening OSS device "/dev/sound/dsp": No such file or directory
Sep 25 22:01:48 flamingo mpd[1647]: output: Attempting to detect a pulse audio device
Sep 25 22:01:48 flamingo mpd[1647]: Assertion 'm' failed at pulse/thread-mainloop.c:236, function pa_threaded_mainloo...orting.
Hint: Some lines were ellipsized, use -l to show in full.

or,

jorge@flamingo:~$ sudo systemctl start mpd
[sudo] password for jorge: 
jorge@flamingo:~$ systemctl status mpd
● mpd.service - Music Player Daemon
   Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
   Active: failed (Result: signal) since Thu 2014-09-25 22:09:13 EDT; 8s ago
  Process: 2056 ExecStart=/usr/bin/mpd --no-daemon (code=killed, signal=ABRT)
 Main PID: 2056 (code=killed, signal=ABRT)

Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned erro...rectory
Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
Sep 25 22:09:13 flamingo mpd[2056]: alsa_output: Error opening default ALSA device: No such file or directory
Sep 25 22:09:13 flamingo mpd[2056]: output: Attempting to detect a oss audio device
Sep 25 22:09:13 flamingo mpd[2056]: oss_output: Error opening OSS device "/dev/dsp": No such file or directory
Sep 25 22:09:13 flamingo mpd[2056]: oss_output: Error opening OSS device "/dev/sound/dsp": No such file or directory
Sep 25 22:09:13 flamingo mpd[2056]: output: Attempting to detect a pulse audio device
Sep 25 22:09:13 flamingo mpd[2056]: Assertion 'm' failed at pulse/thread-mainloop.c:236, function pa_threaded_mainloo...orting.
Hint: Some lines were ellipsized, use -l to show in full.

Here is the mpd config file:

jorge@flamingo:~$ cat ~/.mpd/mpd.conf 
music_directory "/home/jorge/Multimedia/Audio/Music"  
playlist_directory "/home/jorge/.mpd/playlists"   
db_file "~/.mpd/mpd.db"  
log_file "~/.mpd/mpd.log"  
pid_file "~/.mpd/mpd.pid"  
state_file "~/.mpd/mpdstate"  
audio_output {  
    type  "alsa"  
    name  "MPD"  
}  
restore_paused "yes"
follow_inside_symlinks      "no"

Any ideas what I'm doing wrong here?

Thanks in advance.

Last edited by geo909 (2014-09-26 02:12:30)

Offline

#2 2014-09-26 02:29:26

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Cannot start mpd as systemd service

What package version?

Offline

#3 2014-09-26 02:56:49

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: Cannot start mpd as systemd service

Scimmia wrote:

What package version?

It's 0.18.14-2

Here's everything:

Name           : mpd
Version        : 0.18.14-2
Description    : Flexible, powerful, server-side application for playing music
Architecture   : i686
URL            : http://www.musicpd.org/
Licenses       : GPL
Groups         : None
Provides       : None
Depends On     : libao  ffmpeg  libmodplug  audiofile  libshout  libmad  curl  faad2  sqlite  jack  libmms  wavpack  avahi
                 libid3tag  yajl  libmpdclient
Optional Deps  : None
Required By    : None
Optional For   : None
Conflicts With : None
Replaces       : None
Installed Size : 679.00 KiB
Packager       : Gaetan Bisson <bisson@archlinux.org>
Build Date     : Mon 15 Sep 2014 01:31:42 PM EDT
Install Date   : Tue 23 Sep 2014 11:24:35 PM EDT
Install Reason : Explicitly installed
Install Script : Yes
Validated By   : Signature

Offline

#4 2014-09-26 03:01:17

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Cannot start mpd as systemd service

Yeah, you're out of date. Update your system and everything should work.

Offline

#5 2014-09-26 03:09:54

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: Cannot start mpd as systemd service

geo909 wrote:

Here is the mpd config file:

jorge@flamingo:~$ cat ~/.mpd/mpd.conf

if you're starting mpd as a system service, then your user's config won't be used

Offline

#6 2014-09-26 04:00:23

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: Cannot start mpd as systemd service

Scimmia wrote:

Yeah, you're out of date. Update your system and everything should work.

*facepalm*

Oh dear.. An update fixed the problem indeed, thank you.


HilmTye wrote:

if you're starting mpd as a system service, then your user's config won't be used

You're right.. I just read the wiki more carefully. Indeed, I would like to run it for my user, so systemd is not
the best option for me. But I still have trouble.. The problem is that I can't autostart it the way it mentions
in the wiki. My mpd files are as follows:

jorge@flamingo:~$ ls ~/.mpd
mpd.conf  mpd.db  mpd.log  mpd.pid  mpdstate  playlists

I tried this as per the wiki:

jorge@flamingo:~$ cat ~/.profile
# MPD daemon start (if no other user instance exists)
[ ! -s ~/.mpd/mpd.pid ] && mpd 

but it didn't work. mpd was not running after reboot.

Then I tried /etc/profile:

jorge@flamingo:~$ cat /etc/profile
# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

export GPODDER_HOME="/home/jorge/Applications/Application Data/gpodder"

# MPD daemon start (if no other user instance exists)
[ ! -s ~/.mpd/mpd.pid ] && mpd 

but it didn't work either.

In both cases, if I try to run mpd again from the terminal, I get:

jorge@flamingo:~$ mpd
server_socket: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)

and then mpd works.

Any ideas on how to startup mpd automatically on boot without systemd?

Last edited by geo909 (2014-09-26 04:03:15)

Offline

#7 2014-09-26 04:04:55

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: Cannot start mpd as systemd service

make sure the systemd service is disabled

Offline

#8 2014-09-26 04:11:34

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: Cannot start mpd as systemd service

HiImTye wrote:

make sure the systemd service is disabled

The service is disabled, and the system rebooted, but I still have that problem..

Offline

Board footer

Powered by FluxBB