You are not logged in.

#1 2013-07-16 07:48:27

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

[SOLVED] MPD database/possible permission errors.

The problem: ncmpcpp doesn't see my database/music files.

I thought the issue might be the way I set up MPD. I followed the instructions in the archwiki on local configuration as well as the "autostart with systemd" section.

I've been able to play music and such for the last few weeks up until now, even through multiple full system upgrades, so I don't suspect anything that to be a cause for my problems.

When I do

sudo systemctl status mpd

I get:

mpd.service - Music Player Daemon
   Loaded: loaded (/etc/systemd/system/mpd.service; static)
   Active: active (running) since Tue 2013-07-16 00:32:38 PDT; 7min ago
 Main PID: 10351 (mpd)
   CGroup: name=systemd:/system/mpd.service
           └─10351 /usr/bin/mpd --stdout --no-daemon

Jul 16 00:32:38 gestalt systemd[1]: Started Music Player Daemon.
Jul 16 00:32:38 gestalt mpd[10351]: Found db_file setting without music_directory - disabling database
Jul 16 00:32:38 gestalt mpd[10351]: output: No "audio_output" defined in config file
Jul 16 00:32:38 gestalt mpd[10351]: output: Attempt to detect audio output device
Jul 16 00:32:38 gestalt mpd[10351]: output: Attempting to detect a alsa audio device
Jul 16 00:32:38 gestalt mpd[10351]: Home directory not accessible: Permission denied
Jul 16 00:32:38 gestalt mpd[10351]: output: Successfully detected a alsa audio device
Jul 16 00:32:38 gestalt mpd[10351]: No global port, disabling zeroconf
Jul 16 00:32:38 gestalt mpd[10351]: state_file: failed to open /var/lib/mpd/mpdstate: No such file or directory
Jul 16 00:37:38 gestalt mpd[10351]: state_file: failed to create /var/lib/mpd/mpdstate: Permission denied

But in my configuration file, I have both the music_directory and db_file settings set. Am I misunderstanding something about how the systemd autostart method is supposed to work? Is it something that just doesn't work with the local configuration method at all?

Last edited by brokengestalt (2013-07-16 23:28:09)

Offline

#2 2013-07-16 08:18:08

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: [SOLVED] MPD database/possible permission errors.

Can you post your MPD configfile?


Use the Source, Luke!

Offline

#3 2013-07-16 09:50:52

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,724
Website

Re: [SOLVED] MPD database/possible permission errors.

It looks like you've confused yourself. You say you followed the local user mpd guide, but you've started a system-wide service, not a user service, and this is running as the mpd user, not you.

Can you clarify which you're trying to achieve?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2013-07-16 10:42:39

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] MPD database/possible permission errors.

My config file:

# An example configuration file for MPD
# See the mpd.conf man page for a more detailed description of each parameter.


# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This 
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory		"/home/xz/Music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use 
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory		"~/.mpd/playlist"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the 
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file			"~/.mpd/db"
# 
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, otherwise logging is disabled.
#
log_file			"~/.mpd/log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file			"~/.mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server 
# state will be reset on server start up.
#
state_file			"~/.mpd/state"
#
# The location of the sticker database.  This is a database which
# manages dynamic information attached to songs.
#
#sticker_file			"~/.mpd/sticker.sql"
#
###############################################################################


# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
#user				"xz"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group				"nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon.
#
# For network
bind_to_address		"any"
#
# And for Unix Socket
#bind_to_address		"~/.mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
#port				"6600"
#
# This setting controls the type of information which is logged. Available 
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
#log_level			"default"
#
# If you have a problem with your MP3s ending abruptly it is recommended that 
# you set this argument to "no" to attempt to fix the problem. If this solves
# the problem, it is highly recommended to fix the MP3 files with vbrfix
# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
# point gapless MP3 playback can be enabled.
#
#gapless_mp3_playback			"yes"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists	"no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the mpd.conf man page.
#metadata_to_use	"artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This setting enables automatic update of MPD's database when files in 
# music_directory are changed.
#
auto_update	"yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself.  There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################

I want to start it as a user service.

Offline

#5 2013-07-16 10:50:34

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: [SOLVED] MPD database/possible permission errors.

Uncomment the line:

#user "xz"

Use the Source, Luke!

Offline

#6 2013-07-16 12:26:53

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,724
Website

Re: [SOLVED] MPD database/possible permission errors.

I think you need to reread the 'Autostart with systemd' section.

For now, stop the system service:

# systemctl stop mpd

and then run mpd as your regular user:

$ mpd

Does this work?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2013-07-16 23:27:55

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] MPD database/possible permission errors.

Ah, forgot to come back to this post after I posted my config file, but I tried just that after re-reading the autostart with systemd section. This works. Also, what was the benefit of defining username? If I don't define it, it just uses "mpd," right?

Offline

#8 2013-07-17 07:47:03

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,724
Website

Re: [SOLVED] MPD database/possible permission errors.

Only if you're running it as a system daemon. If you're running it as a regular user, it runs as that user.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB