I copied from the wrong source, sorry. The following is the correct init
script:
#!/sbin/runscript
# Remove "/usr/local" when liquidsoap is entirely installed via Portage
or otherwise does not use /usr/local.
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
interrupting 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}"
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}
}
stop() {
ebegin "Stopping Liquidsoap..."
start-stop-daemon --stop --pidfile "${pidfile}" --exec ${command} --
--PidFile "${pidfile}"
eend $?
}
On 08/16/13 16:53, Damien Moody wrote:
> With a little help from the Gentoo forums, I've modified the Gentoo init
> script. It has not been working correctly because of a missing stop().
>
> Also, you may need to take /usr/local out of ${command} and ${pidfile},
> depending on your setup.
>
> #!/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
> interrupting 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
------------------------------------------------------------------------------
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