Hi,
Here is an init script for mpd (music player daemon) in order to start/stop it in boot phase.
Just need to put it in /etc/init.d
and add "mpd" in the RUN_DAEMONS of /etc/rcS.conf
hope it will be useful,
Hi,
Here is an init script for mpd (music player daemon) in order to start/stop it in boot phase.
Just need to put it in /etc/init.d
and add "mpd" in the RUN_DAEMONS of /etc/rcS.conf
hope it will be useful,
#!/bin/sh
# /etc/init.d/mpd: Start, stop and restart mpd deamon on SliTaz, at boot
# time or with the command line.
#
# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
# variable of /etc/rcS.conf and configure options with /etc/mpd.conf.
#
. /etc/init.d/rc.functions
NAME=mpd
DESC="Music Player Daemon"
DAEMON=/usr/sbin/mpd
OPTION="/etc/mpd.conf"
case "$1" in
start)
echo -n "Starting $DESC: $NAME... "
$DAEMON $OPTION &> /dev/null
status
;;
stop)
echo -n "Stopping $DESC: $NAME... "
$DAEMON --kill &> /dev/null
status
;;
restart)
echo -n "Restarting $DESC: $NAME... "
$DAEMON --kill &> /dev/null
sleep 2
$DAEMON $OPTION &> /dev/null
status
;;
*)
echo ""
echo -e "33[1mUsage:33[0m /etc/init.d/basename $0
[start|stop|restart]"
echo ""
exit 1
;;
esac
exit 0
Not sure how this script could not have been included as part of the MPD package, but it works. I had to recreate the mpd database on every boot without it. If you're doing this for the first time like I was, note that you have to set the file permissions to include Execute.
Which is logical and only requires using chmod +x
You must log in to post.