如果不手动杀死液体肥皂,就不能重新出售液体肥皂

问题描述 投票:1回答:2

我目前在Ubuntu 14.4上运行Liquidsoap,并通过流媒体传输到Icecast,托管在同一台机器上。

我的设置正常运行,但是在运行sudo服务liquidsoap重新启动时,出现以下错误:

fatal error exception unix.unix_error(50, "bind", "" )

为了重新启动液体肥皂,我需要终止该过程或重新启动。

然后它将正确运行。直到出于任何原因需要重新启动。

作为旁注,liquidsoap创建了一个用户和一个名为Liquidsoap的组,但是我正在通过我创建的另一个用户运行sudo命令。

有人有什么想法吗?

linux port ubuntu-14.04 icecast liquidsoap
2个回答
1
投票

通过启用pid文件修复。

我的init.d的副本-https://gist.github.com/anonymous/d7e232fc280d2fe1df56

#!/bin/sh
### BEGIN INIT INFO
# Provides:          liquidsoap
# Required-Start:    $remote_fs $network $time
# Required-Stop:     $remote_fs $network $time
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts the liquidsoap daemon
# Description:
### END INIT INFO

user=liquidsoap
group=liquidsoap
prefix=/usr
exec_prefix=${prefix}
confdir=/etc/liquidsoap
liquidsoap=${exec_prefix}/bin/liquidsoap
rundir=/var/run/liquidsoap

# Test if $rundir exists
if [ ! -d $rundir ]; then
  mkdir -p $rundir;
  chown $user:$group $rundir
fi

case "$1" in
  stop)
    echo -n "Stopping liquidsoap channels: "
    cd $rundir
    has_channels=
    for liq in *.pid ; do
      if test $liq != '*.pid' ; then
        has_channels=1
        echo -n "$liq "
        start-stop-daemon --stop --quiet --pidfile $liq --retry 4
      fi
    done
    if test -n "$has_channels"; then
      echo "OK"
    else
      echo "no script found in $confdir"
    fi
    ;;

  start)
    echo -n "Starting liquidsoap channels: "
    cd $confdir
    has_channels=
    for liq in *.liq ; do
      if test $liq != '*.liq' ; then
        has_channels=1
        echo -n "$liq "
        start-stop-daemon --start --quiet --pidfile $rundir/${liq%.liq}.pid \
          --chuid $user:$group --exec $liquidsoap -- -d $confdir/$liq
      fi
    done
    if test -n "$has_channels"; then
      echo "OK"
    else
      echo "no script found in $confdir"
    fi
    ;;

  restart|force-reload)
    $0 stop
    $0 start
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

0
投票

没有提到的解决方案解决了我的问题。我最近不得不通过在启动守护程序后立即设置适当的所有权和权限来修复它。在终止进程并重新启动之后,可以进一步重新启动工作正常。

start-stop-daemon --start --quiet --pidfile $rundir/${liq%.liq}.pid \
  --chuid $user:$group --exec $liquidsoap -- -d $confdir/$liq  && sleep 1 && chmod 600 $rundir/${liq%.liq}.pid && chown root:root $rundir/${liq%.liq}.pid
© www.soinside.com 2019 - 2024. All rights reserved.