Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automated start, stop script for daap on Red Hat' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automated start, stop script for daap on Red Hat
Authored by: migurski on Oct 30, '03 01:29:57PM

The following script can be used to start and stop daap service automatically. When placed in /etc/init.d/ (Red Hat), it becomes a service that can be started up at boot time. Modify $musicdir to suit your local configuration.


#!/bin/sh
# chkconfig: 5 99 1
# description: in Soviet Russia, music listens to YOU

musicdir=/usr/local/share/apache/htdocs/music

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
export PATH

mode=$1    # start or stop

case "$mode" in
  'start')
    echo "Starting iTunes music service"

    mDNSProxyResponderPosix 192.168.1.1 squeal "Studio Music" _daap._tcp 3689 &
    sleep 5
    daapd -C $musicdir/daapd.cache $musicdir &
    sleep 5

    ;;

  'stop')
    echo "Stopping iTunes music service"

    for PROG in daapd mDNSProxyResponderPosix; do
        for PID in `ps -C $PROG -o pid`; do
            if [ $PID != 'PID' ]; then
                kill -15 $PID;
                sleep 2;
            fi;
        done;
    done;
    ;;

  'restart')
    $0 stop
    $0 start
    ;;

  'status')
    for PID in `ps -C daapd -o pid`; do
        if [ $PID != 'PID' ]; then
            PID1=$PID;
        fi;
    done;
    for PID in `ps -C mDNSProxyResponderPosix -o pid`; do
        if [ $PID != 'PID' ]; then
            PID2=$PID;
        fi;
    done;
    echo "daap (pids ${PID1}, ${PID2}) is running...";
    ;;

  *)
    # usage
    echo "usage: $0 start|stop|restart"
    exit 1
    ;;
esac


[ Reply to This | # ]
Automated start, stop script for daap on Red Hat
Authored by: nyamuk on Nov 20, '03 05:52:01PM
Thank you for posting your initscript. Im having problems with the following :

    daapd -C $musicdir/daapd.cache $musicdir &
Will not work with the arguments "-C musicdir/daapd.cache $musicdir &" The service shows up on clients but there are no songs. But will work with :

daapd &
My script posted below:

#!/bin/sh
# chkconfig: 5 99 1
# description: in Soviet Russia, music listens to YOU

musicdir=/var/itunz

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
export PATH

mode=$1    # start or stop

case "$mode" in
  'start')
    echo "Starting iTunes music service"

    mDNSProxyResponderPosix 192.168.1.1 squeal "Studio Music" _daap._tcp 3689 &
    sleep 5
    daapd  &
    sleep 5

    ;;

  'stop')
    echo "Stopping iTunz music service"

    for PROG in daapd mDNSProxyResponderPosix; do
        for PID in `ps -C $PROG -o pid`; do
            if [ $PID != 'PID' ]; then
                kill -15 $PID;
                sleep 2;
            fi;
        done;
    done;
    ;;

  'restart')
    $0 stop
    $0 start
    ;;

  'status')
    for PID in `ps -C daapd -o pid`; do
        if [ $PID != 'PID' ]; then
            PID1=$PID;
        fi;
    done;
    for PID in `ps -C mDNSProxyResponderPosix -o pid`; do
        if [ $PID != 'PID' ]; then
            PID2=$PID;
        fi;
    done;
    echo "daap (pids ${PID1}, ${PID2}) is running...";
    ;;

  *)
    # usage
    echo "usage: $0 start|stop|restart"
    exit 1
    ;;
esac


[ Reply to This | # ]