成长值: 255 签到天数: 4710 天 [LV.Master]伴坛终老
|
发表于 2018/3/12 05:02
|
显示全部楼层
|阅读模式
|Google Chrome 65.0.3325.146 |Windows 10
有时候遇到某家openvz虚拟化的/etc/rc.d/rc.local文件启动不管用,怎么折腾都不行,估计是母鸡坏了
那就使用chkconfig 方式来开机启动kangle
- #!/bin/bash
- #
- # kangle Startup script for the Apache HTTP Server
- #
- # chkconfig: - 85 15
- # description: Apache is a World Wide Web server. It is used to serve \
- # HTML files and CGI.
- # processname: kangle
- # config: /etc/kangle/conf/kangle.conf
- # config: /etc/sysconfig/kangle
- # pidfile: /var/run/kangle.pid
- # Source function library.
- . /etc/rc.d/init.d/functions
- KANGLE_LANG=${HTTPD_LANG-"C"}
- # This will prevent initlog from swallowing up a pass-phrase prompt if
- # mod_ssl needs a pass-phrase from the user.
- INITLOG_ARGS=""
- # Set HTTPD=/usr/sbin/kangle.worker in /etc/sysconfig/kangle to use a server
- # with the thread-based "worker" MPM; BE WARNED that some modules may not
- # work correctly with a thread-based MPM; notably PHP will refuse to start.
- # Path to the apachectl script, server binary, and short-form for messages.
- prog=kangle
- pidfile=${PIDFILE-/vhs/kangle/var/kangle.pid}
- RETVAL=0
- # The semantics of these two functions differ from the way apachectl does
- # things -- attempting to start while running is a failure, and shutdown
- # when not running is also a failure. So we just do it the way init scripts
- # are expected to behave here.
- start() {
- echo -n $"Starting $prog: "
- LANG=$HTTPD_LANG
- ulimit -n 51200
- /vhs/kangle/bin/kangle
- RETVAL=$?
- echo
- [ $RETVAL = 0 ]
- return $RETVAL
- }
- # When stopping kangle a delay of >10 second is required before SIGKILLing the
- # kangle parent; this gives enough time for the kangle parent to SIGKILL any
- # errant children.
- stop() {
- echo -n $"Stopping $prog: "
- /vhs/kangle/bin/kangle -q
- }
- restart() {
- echo -n $"Restarting $prog: "
- stop
- start
- }
- # See how we were called.
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- reload)
- reload
- ;;
- *)
- echo $"Usage: $prog {start|stop|restart}"
- exit 1
- esac
- exit $RETVAL
复制代码
给予权限
- chmod +x /etc/init.d/kangle
复制代码 然后注册下启动服务
- chkconfig --level 35 kangle on
复制代码
chkconfig --list 查看Linux开机启动项列表
reboot重启,发现还是不能正常启动kangle,ok,换商家吧,或者手动启动下
然后也可以用下面命令来管理kangle重启
service kangle restart
|
|