I am starting mpd with an init script, and it works wonderfull, my only problem is that mpd's state often is set to play, so when I turn on my computer it starts to play, this is not something I want, so i'm wondering if there is anyway mpd can be started with its state set to stop og pause?
This is my /etc/init.d/mpd script
Code: Select all
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/mpd-svn/files/mpd.rc6,v 1.4 2005/10/24 13:42:28 ticho Exp $
USER=MicrosoftBob
pidfile="/home/$USER/.mpd/mpd.pid"
depend() {
need alsasound localmount
use netmount nfsmount
}
checkconfig() {
if ! [ -f /home/$USER/.mpdconf ]; then
eerror "Configuration file /home/$USER/.mpdconf does not exist."
return 1
fi
return 0
}
start() {
start mpd now playingcheckconfig || return 1
ebegin "Starting Music Player Daemon"
start-stop-daemon --chuid $USER:users --start --exec /usr/bin/mpd -- --no-create-db /home/$USER/.mpdconf
eend $?
}
stop() {
ebegin "Stopping Music Player Daemon"
start-stop-daemon --chuid $USER:users --stop --pidfile ${pidfile}
eend $?
}

