在运行OpenWrt 18.06.2的Ubiquiti Unifi AC-Lite AP上安装了coova-chilli 1.3.1-svn。尝试使用以下命令启动辣椒时:
chilli --debug --fg
我总是收到以下错误:
coova-chilli[27966]: options.c: 181: could not generate configuration (/var/run/chilli.27966.cfg.bin), sleeping one second
我已经在这个错误中停留了很长时间。我尝试在配置文件中进行更改,安装和重新安装coova-chilli软件包,但无济于事。
我认为您必须使用/etc/init.d/chilli start
命令首次将辣椒作为服务运行。
下面是一个有效的辣椒 init.d 服务代码。如果您没有服务启动文件,您将执行复制并将以下代码粘贴到"/etc/init.d/"中作为文件名"chilli"。然后编辑配置的路径。
#!/bin/sh
#
# chilli - CoovaChilli
#
# chkconfig: 2345 65 35
# description: CoovaChilli
# Source function library.
. /usr/local/etc/chilli/functions
exec="/usr/local/sbin/chilli"
prog=$(basename $exec)
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
MULTI=$(ls /usr/local/etc/chilli/*/chilli.conf 2>/dev/null)
[ -z "$DHCPIF" ] && [ -n "$MULTI" ] && {
for c in $MULTI;
do
echo "Found configuration $c"
DHCPIF=$(basename $(echo $c|sed 's#/chilli.conf##'))
export DHCPIF
echo "Running DHCPIF=$DHCPIF $0 $*"
sh $0 $*
done
exit
}
pidfile=/usr/local/var/run/chilli.pid
CONFIG=/usr/local/etc/chilli.conf
if [ -n "$DHCPIF" ]; then
CONFIG=/usr/local/etc/chilli/$DHCPIF/chilli.conf
pidfile=/usr/local/var/run/chilli.$DHCPIF.pid
fi
[ -f $CONFIG ] || {
echo "$CONFIG not found"
exit 0
}
start() {
echo -n $"Starting $prog: "
check_required
/sbin/modprobe tun >/dev/null 2>&1
echo 1 > /proc/sys/net/ipv4/ip_forward
[ -e /dev/net/tun ] || {
(cd /dev; mkdir net; cd net; mknod tun c 10 200)
}
writeconfig
radiusconfig
test ${HS_ADMINTERVAL:-0} -gt 0 && {
(crontab -l 2>&- | grep -v $0
echo "*/$HS_ADMINTERVAL * * * * $0 radconfig") | crontab - 2>&-
}
test ${HS_LANIF_KEEPADDR:-0} -eq 0 && ip address add 0.0.0.0 dev $HS_LANIF
daemon -- $exec -c $CONFIG
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
crontab -l 2>&- | grep -v $0 | crontab -
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
[ $retval -eq 0 ] && rm -f $PIDFILE
[ $retval -eq 0 ] && rm -f $RUN_D/$IPCFILE
[ $retval -eq 0 ] && rm -f $CMDSOCK
[ $retval -eq 0 ] && /bin/rm -f /usr/local/var/run/chilli.*.cfg.bin
return $retval
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
force-reload)
restart
;;
status)
status $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
# If config can be reloaded without restarting, implement it here,
# remove the "exit", and add "reload" to the usage message below.
# For example:
# status $prog >/dev/null || exit 7
# killproc $prog -HUP
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
esac
确保已安装守护程序。如果没有,则显示 deamon 不 found.so 安装它。