I have the following init script to start liquidsoap on Gentoo. I need
to modify it, and I'm not sure how. It is supposed to be used like
net.lo - you make a symlink to it such as liquidsoap.main. The problem
is, when I do that, it starts the first process and thereafter produces
no error about new processes, but the new processes aren't actually started.

For example, /etc/init.d/liquidsoap.main start starts up and everything
works as expected. If I then do /etc/init.d/liquidsoap.ambient start, I
can see ambient.pid in /usr/local/var/run/liquidsoap, but there is no
process other than liquidsoap.main found by ps aux | grep liquidsoap.

How should this script be changed to fix this?

/etc/init.d/liquidsoap:

#!/sbin/runscript

script=${RC_SVCNAME#*.}
scriptfile="/etc/liquidsoap/${script}.liq"
command=/usr/local/bin/liquidsoap
command_args="--daemon -t ${scriptfile}"
start_stop_daemon_args="--user liquidsoap:liquidsoap --nicelevel -15 "
pidfile="/usr/local/var/run/liquidsoap/${script}.pid"
name=${RC_SVCNAME}

description="Liquidsoap deamon that obeys ${scriptfile}"
extra_commands="check"
description_check="Check and evaluate stream scripts without interupting
streaming."

depend() {
    need localmount
    use net
    after alsasound icecast
}

_script_exists() {
    if [ "${script}" = "${RC_SVCNAME}" ]; then
        eerror "You have to create an init script for each stream script:"
        eerror "ln -s liquidsoap /etc/init.d/liquidsoap.<script>"
        eerror "where script refers to /etc/liquidsoap/<script>.liq"
        return 1
    fi

    if [ ! -f "${scriptfile}" ]; then
        eerror "${scriptfile} not found"
        return 1
    fi
}

check() {
    _script_exists || return 1
    einfo "Checking ${scriptfile}"
    use net
    after alsasound icecast
}

_script_exists() {
    if [ "${script}" = "${RC_SVCNAME}" ]; then
        eerror "You have to create an init script for each stream script:"
        eerror "ln -s liquidsoap /etc/init.d/liquidsoap.<script>"
        eerror "where script refers to /etc/liquidsoap/<script>.liq"
        return 1
    fi

    if [ ! -f "${scriptfile}" ]; then
        eerror "${scriptfile} not found"
        return 1
    fi
}

check() {
    _script_exists || return 1
    einfo "Checking ${scriptfile}"
    check_result=`$command --check-lib ${scriptfile}`
    eend $? ${check_result}
    return $?
}

start_pre() {
    _script_exists || return 1
}

start() {
    start-stop-daemon --start  \
        ${start_stop_daemon_args} \
        --pidfile ${pidfile} \
        --exec ${command} \
        -- ${command_args}
}

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to