我使用direct download在我的服务器上安装了Icecast 2.4.3以获取最新版本。
通过这种方式,我不会使用我的发行版(debian 8)发布的版本,因此默认情况下不会激活该守护进程。
我找到了一个用相应的路径修改过的脚本,但执行错误。
脚本 icecast.sh
:
#!/bin/bash
#
# Init file for Icecast server daemon
#
# chkconfig: 345 55 25
# description: Icecast streaming mp3 server daemon
#
# processname: icecast
# config: /etc/icecast.xml
# pidfile: /var/run/icecast.pid
# source function library
# . /etc/rc.d/init.d/functions : returns an error on debian 8
. /lib/lsb/init-functions
# pull in sysconfig settings
[ -f /etc/sysconfig/icecast ] && . /etc/sysconfig/icecast
RETVAL=0
prog="icecast"
# Some functions to make the below more readable
PREFIX=/usr/local
PATH=$PATH:$PREFIX/bin
PIDFILE=/icecast/icecast.pid
CONF_FILE=/icecast/conf/icecast.xml
[ -f $PREFIX/bin/icecast ] || ( echo Failed to locate icecast binary: $PREFIX/bin/icecast && exit )
[ -f $CONF_FILE ] || ( echo Failed to locate icecast configuration file: $CONF_FILE && exit )
OPTIONS="-b -c $CONF_FILE"
start()
{
echo -n $"Starting $prog:"
ulimit -c unlimited # dump core for debugging purposes
ulimit -n 32768
daemon icecast icecast $OPTIONS
RETVAL=$?
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/icecast
echo
pidof icecast > $PIDFILE
return $RETVAL
}
stop()
{
echo -n $"Stopping $prog:"
killproc icecast -TERM
RETVAL=$?
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/icecast
echo
rm -f $PIDFILE
return $RETVAL
}
reload()
{
echo -n $"Reloading $prog:"
killproc icecast -HUP
RETVAL=$?
echo
return $RETVAL
}
condrestart()
{
[ -e /var/lock/subsys/icecast ] && restart
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
# wait for listening sockets to clear
echo "Waiting 5 seconds before restarting..."
sleep 5
start
;;
reload)
reload
;;
condrestart)
condrestart
;;
status)
status icecast
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
RETVAL=1
esac
exit $RETVAL
我在做sh icecast.sh status
时遇到的错误:
# sh icecast.sh status
icecast.sh: line 93: status : unknow command
Q1 :如何修复此错误?
Q2 :如何获得icecast restart service
等功能命令?
Q3 :如果服务器重启,我应该怎么做才能自动重启Icecast?
答案 0 :(得分:2)
答案是使用debian backports中的正确的包,或者需要TLS支持来自official Xiph.org repositories的包。
这保证您将收到软件包更新,而无需自行监控版本并找出必要的更改。
另请注意,此时Linux / Unix的最新版本为 2.4.2 ,因为2.4.3是 Windows 只发布。如果为Linux / Unix编译,代码是相同的。
答案 1 :(得分:1)
apt-get install icecast2
,yum install icecast
,无论如何)安装软件包。通常pakage manager也会安装init脚本,允许你启动/停止Icecast。which icecast
或whereis icecast
/etc/inid/icecast restart
或systemctr restart iecast
现在可以使用您的Icecast版本。systemctl enable icecast