解决方法
我不知道Sphinx,但这是基本的方法.使用以下内容创建一个文件/etc/init.d/searchd(也有
this script,但您可能需要稍微调整一下):
- #!/bin/bash
- case "${1:-''}" in
- 'start')
- # put the command to start sphinx
- # i.e.,/usr/bin/searchd start or /usr/bin/searchd --daemon or whatever the command is
- ;;
- 'stop')
- # stop command here
- ;;
- 'restart')
- # restart command here
- ;;
- *)
- echo "Usage: $SELF start|stop|restart"
- exit 1
- ;;
- esac
然后执行以下操作:
- $sudo update-rc.d searchd defaults
要手动控制服务:
- $sudo /etc/init.d/searchd <start|stop|restart>