You are not logged in.

#1 2010-10-27 08:51:02

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

[Solved]Starting MPD paused

I'm installing gmpc and for it to work I need MPD. I followed the wiki and understood everything apart from the "Never play on start - Method 1" part. My /etc/rc.d/mdp looks like this:

#!/bin/bash

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

case "$1" in
  start)
    stat_busy "Starting Music Player Daemon"
    [ ! -d /var/run/mpd ] && install -d -g 45 -o 45 /var/run/mpd
    /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
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

I am not sure where I should put the code mentioned in "Method 1". Could somebody give me a hint? Thanks.

Last edited by C5OK5Y (2010-11-19 20:26:52)

Offline

#2 2010-10-27 12:31:59

ilusi0n
Member
Registered: 2010-06-09
Posts: 187

Re: [Solved]Starting MPD paused

between:

 stat_busy "Starting Music Player Daemon"

and

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

Is what I see from what is read there.

Or you could use the method 2 which is more simple I guess.

Last edited by ilusi0n (2010-10-27 12:36:50)

Offline

#3 2010-10-27 13:56:06

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: [Solved]Starting MPD paused

@ilusi0n
But there allready is something between those two lines:

stat_busy "Starting Music Player Daemon"
[ ! -d /var/run/mpd ] && install -d -g 45 -o 45 /var/run/mpd            <--- This line
/usr/bin/mpd /etc/mpd.conf &> /dev/null

Should I replace it?

Offline

#4 2010-10-28 15:55:56

ilusi0n
Member
Registered: 2010-06-09
Posts: 187

Re: [Solved]Starting MPD paused

Now that you mention... yes there is a line between. I don't really know sorry hmm.
I use mpd as well and I took the second option which for me, was more simple.

Offline

#5 2010-11-19 20:25:37

C5OK5Y
Member
Registered: 2010-07-04
Posts: 48

Re: [Solved]Starting MPD paused

OK I solved it by replacing the content in between the two lines with the code suggested in the wiki (Method 1). Now when I pause the music and restart my PC I can resume playback exactly where I ended. smile

Offline

Board footer

Powered by FluxBB