ttserver 用ttservctl启动,默认是全部的host可以访问
如果在配置文件加了
prog="ttservctl"
cmd="ttserver"
basedir="/var/ttserver"
host="192.168.100.151" #光加这个不起作用
port="1978"
除了加上上面的之外,还要
在脚本里加
start(){
printf 'Starting the server of Tokyo Tyrant\n'
mkdir -p "$basedir"
if [ -z "$basedir" ] || [ -z "$port" ] || [ -z "$pidfile" ] || [ -z "$dbname" ] ; then
printf 'Invalid configuration\n'
retval=1
elif ! [ -d "$basedir" ] ; then
printf 'No such directory: %s\n' "$basedir"
retval=1
elif [ -f "$pidfile" ] ; then
pid=`cat "$pidfile"`
printf 'Existing process: %d\n' "$pid"
retval=1
else
cmd="$cmd -port $port -dmn -pid $pidfile"
if [ -n "$host" ] ; then
cmd="$cmd -host $host"
fi
if [ -n "$logfile" ] ; then
cmd="$cmd -log $logfile"
fi