JAVA、PHP、前端、APP、网站开发 - 开发技术学习

文档标签: shell守护进程

shell守护进程,shell监控脚本.

最近优化了在线考试系统,使用了消息队列,在php命令模式下操作就需要保证mq消费者保持在线.于是就有了shell守护进程的要求。新shell脚本mq.sh#!/bin/shprocnum=`ps -ef|grep "consumer"|grep -v grep|wc -l`if [ $procnum -eq 0 ]; then  nohup /usr/bin/php /xxxxx/wwwroot/yii examination/consumer > /tmp.log 2>&1 &fi添加执行权限:chmod +x mq.sh然后在定时任务时添加*/1 * * * * /home/ubuntu/mq.sh经过生产环境使用两天没有问题。...
此文被围观1780次  分类: 服务器 标签:  ··

站点声明:部分内容源自互联网,为传播信息之用,如有侵权,请联系我们删除。

© Copyright 2011-2024 www.kfju.com. All Rights Reserved.
超级字帖 版权所有。蜀ICP备12031064号