Vous n'êtes pas connecté.
Pages: 1
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/[c]basename $0[/c] [start|stop|restart]"
echo ""
exit 1
;;
esac
exit 0
Hi,
Pushed: http://hg.slitaz.org/wok/rev/6b69e208e751
Thanks,
-pascal
Hors ligne
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.
Hors ligne
Which is logical and only requires using chmod +x
Hors ligne
Pages: 1
[ Généré en 0.017 secondes, 7 requêtes exécutées - Utilisation de la mémoire: 1.53 MiO (Pic : 1.77 MiO) ]