/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
确保你安装了守护进程。如果没有,它显示没有找到守护进程。所以安装它。