Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37525330
en ru br
ALT Linux repos
S:0.23.13-alt1
D:0.13.0-alt1.1
5.0: 0.13.2-alt3
4.1: 0.13.1-alt1
4.0: 0.13.0-alt3
3.0: 0.11.5-alt1.1

Group :: Sound
RPM: mpd

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# mpd This shell script takes care of starting and stopping
# Music Player Daemon (MPD).
# chkconfig: - 99 01
# description: Music Player Daemon (MPD) allows remote access \
# for playing music and managing playlists.
# processname: mpd
# config: /etc/mpd.sys.conf
# pidfile: /var/run/mpd.pid

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

USER=@MPD_USER@
CONFFILE=/etc/mpd.sys.conf
PIDFILE=/var/run/mpd/pid
LOCKFILE=/var/lock/subsys/mpd
RETVAL=0

start()
{
start_daemon --lockfile "$LOCKFILE" --expect-user $USER -- mpd $CONFFILE
RETVAL=$?
return $RETVAL
}

stop()
{
stop_daemon --lockfile "$LOCKFILE" --expect-user $USER -- mpd --kill $CONFFILE
RETVAL=$?
return $RETVAL
}

restart()
{
stop
start
}

createdb()
{
mpd --create-db $CONFFILE
RETVAL=$?
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
createdb)
createdb
;;
status)
status --pidfile "$PIDFILE" --expect-user $USER -- mpd
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|createdb|status}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin