Results 1 to 3 of 3

Thread: Solved: mpd could not open pid_file "/var/run/mpd/pid" (at line 13)

  1. #1
    Join Date
    Apr 2006
    Beans
    Hidden!

    Solved: mpd could not open pid_file "/var/run/mpd/pid" (at line 13)

    If anybody is having the problem of
    starting the mpd daemon and get the error:

    could not open pid_file "/var/run/mpd/pid" (at line 13) for writing: Permission denied

    then here is your answer:
    first make the directory /var/run/mpd
    sudo mkdir /var/run/mpd

    next, make the file pid
    sudo mousepad /var/run/mpd/pid
    or in ubuntu:
    sudo gedit /var/run/mpd/pid
    and just save as an empty file.

    Next, modify the read/write permissions. This is dangerous and allows anybody with access to your computer to read /var/run/mpd/pid, if that is important to you.
    sudo chmod 777 /var/run/mpd/pid

    Now type sudo /etc/init.d/mpd start and you should be rolling! If you get errors about a log file not being able to be written to, you can change the /etc/mpd.conf settings.

    Type sudo gedit /etc/mpd.conf and change all of the places mpd stores things to ~/mpd.log or ~/mpd.db. Good luck!
    sudo killall python sudo killall amarokapp

  2. #2
    Join Date
    Dec 2007
    Beans
    47
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Solved: mpd could not open pid_file "/var/run/mpd/pid" (at line 13)

    There is simpler and safer way to do this.


    1st
    We move all mpd' files to ~/.mpd. Create this directory if, it's not there.
    2nd
    Now edit properly
    Code:
    /etc/mpd.conf
    Find and edit this part.
    Code:
    # An example configuration file for MPD
    # See the mpd.conf man page for a more detailed description of each parameter.
    
    ######################## REQUIRED PATHS ########################
    # You can put symlinks in here, if you like. Make sure that
    # the user that mpd runs as (see the 'user' config parameter)
    # can read the files in this directory.
    music_directory		"/[your_mp3_dir]"
    playlist_directory	"/home/[user]/.mpd/playlists"
    db_file			"/home/[user]/.mpd/tag_cache"
    log_file		"/home/[user]/.mpd/mpd.log"
    error_file		"/home/[user]/.mpd/errors.log"
    ################################################################
    3rd
    Find and modify this
    Code:
    ######################## DAEMON OPTIONS ########################
    #
    # If started as root, MPD will drop root privileges and run as
    # this user instead.  Otherwise, MPD will run as the user it was
    # started by.  If left unspecified, MPD will not drop root
    # privileges at all (not recommended).
    #
    user                            "[user]"
    Since we run mpd as "ourself", go find and edit this.

    Code:
    ######################## OPTIONAL PATHS ########################
    #
    # If you wish to use mpd --kill to stop MPD, then you must
    # specify a file here in which to store MPD's process ID.
    #
    pid_file		"/home/[user]/.mpd/pid"
    #
    # If specified, MPD will save its current state (playlist,
    # current song, playing/paused, etc.) at exit.  This will be
    # used to restore the session the next time it is run.
    #
    state_file		"/var/lib/mpd/state"
    #
    ################################################################
    Run
    Code:
    touch ~/.mpd/pid
    For finish touches just restart mpd and create collection.
    Ofcourse you can do same with state file. Since I'm not using it, I didn't.

    Cheers.

  3. #3
    Join Date
    Jun 2008
    Beans
    4
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Solved: mpd could not open pid_file "/var/run/mpd/pid" (at line 13)

    Well, why does ubuntu change the directory permission in the first place?

    I always do sudo chown mpd:audio /var/run/mpd for my directory, but I'd like to know how to tell ubuntu to keep these settings.

    Best regards

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •