startup script

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2673
    Anonymous
    Inactive

    Hello, installing on ubuntu.

    Everything’s fine up to script.

    cp contrib/mt-daapd /etc/rc.d/init.d /sbin/chkconfig –add mt-daapd

    looks like 2 commands on one line. It failed for me – so I copied the script directly first then looked for the chkconfig command. I don’t have one.

    So, i just tried to call the script and I get:

    /etc/init.d/mt-daapd: line 10: /etc/init.d/functions: No such file or directory
    Starting DAAP server: /etc/init.d/mt-daapd: line 17: daemon: command not found

    Line 10 from the script is:
    . /etc/init.d/functions

    which in fact does not exist. I’m assuming the script is trying to create this temporarily but using the wrong command?

    I don’t know if there is an analog for daemon on ubuntu, I’ve never used the command myself.

    This seems like it should be very simple – can someone please tell me how I can remedy this?

    thanks,
    John

    #17805
    Anonymous
    Inactive

    Yeah, because the mt-daapd script is trying to call itself….

    Change line 17 to read:

    daemon /usr/local/sbin/mt-daapd

    🙂

    #17806
    Anonymous
    Inactive

    Thanks for the try, but the line 17 error message was generated by the fact that I don’t have the daemon command installed. Ubuntu doesn’t install the daemon command by default.

    Most startup scripts I see in Ubuntu use start-stop-daemon command.

    I’d really rather not install system commands that will be used by only one program (call it my OCD techie aesthetic).

    Does anyone have a script they use on Ubuntu?

    I try not to hack program or script code unless I absolutely have to.

    John

    #17807
    Anonymous
    Inactive

    Looks like you have no option but to hack the script – I had to. What version of Ubuntu are you running and is it Desktop or Server edition? And did you install mt-daapd from source or repository, and what version is it?

    I can probably bang this out at work tomorrow (depending on how my ‘Monday’ is) but need your specifics.

    #17808
    fizze
    Participant

    This is weird because I’ve just reinstalled mt-daapd on Ubuntu just fine.
    FIWI here’s my startup script:

    #! /bin/sh

    ### BEGIN INIT INFO
    # Provides: mt-daapd
    # Required-Start: $local_fs $remote_fs $network $time
    # Required-Stop: $local_fs $remote_fs $network $time
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Multithreaded DAAP music server
    # Description: mt-daapd, a.k.a. Firefly Media Server, is what
    # most people will understand to be an iTunes share
    # server. It uses the DAAP protocol, as iTunes does,
    # and supports streaming MP3 and AAC natively. It can
    # make use of a number of conversion methods to expose
    # Ogg and FLAC files too.
    ### END INIT INFO

    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/usr/sbin/mt-daapd
    NAME=mt-daapd
    DESC=mt-daapd

    test -x $DAEMON || exit 0

    # Include mt-daapd defaults if available
    if [ -f /etc/default/mt-daapd ] ; then
    . /etc/default/mt-daapd
    fi

    set -e

    stopd() {
    echo -n "Stopping $DESC: "
    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
    --signal 2 --exec $DAEMON --oknodo
    echo "$NAME."
    counter=0
    seen=0
    while pidof mt-daapd >/dev/null && [ $counter -lt 15 ]; do
    if [ $seen -eq 0 ]; then
    echo -n "Waiting for mt-daapd to terminate..."
    seen=1
    fi

    counter=$(($counter + 1))
    echo -n "."
    sleep 1
    done
    echo "OK, all clear."
    }

    startd() {
    echo -n "Starting $DESC: "
    start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid
    --exec $DAEMON -- $DAEMON_OPTS 2>/dev/null
    echo "$NAME."
    }

    case "$1" in
    start)
    startd
    ;;
    stop)
    stopd
    ;;
    restart|force-reload)
    stopd
    startd
    ;;
    *)
    N=/etc/init.d/$NAME
    echo "Usage: $N {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
    esac

    exit 0

    btw I just found out that the mt-daapd package or rather some of the javascript dependancies are broken. Not broken in a package sense, but the /playlist.html for instance doesn’t work.
    To make it work again just overwrite everything in mt-daapd/admin-root with the files from a nightly unstable release for instance.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.