大佬教程收集整理的这篇文章主要介绍了linux – monit从启动程序命令中删除引号,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在调试monit启动/停止程序语句.在我的/etc/monit.conf文件中,我的启动程序语句如下所示:
check process node with pidfile /home/ec2-user/blah/node.pid
start program = "/bin/su -c 'export APP_ENV=development; /home/ec2-user/local/bin/node /home/ec2-user/example.com/current/api.js start &> /tmp/monit.out ' "
stop program = "/bin/su -c '/home/ec2-user/local/bin/node /home/ec2-user/example.com/current/api.js stop'""
我在sHell中测试过
$sudo su
# env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/sh
# /bin/su -c '/usr/bin/env APP_ENV=development; /home/ec2-user/local/bin/node /home/ec2-user/example.com/current/api.js start &> /tmp/monit.out '
运行它会在/tmp/monit.out文件中返回正确的输出:
StarTing nodejs daemon...
nodejs daemon started. PID: 16408
但是当我运行sudo monit -v monitor节点时,它会显示一个不同的命令,除了内部单引号被删除之外:
The service list contains the following entries:
Process Name = node
Pid file = /home/ec2-user/blah/node.pid
Monitoring mode = active
Start program = '/bin/su -c export APP_ENV=development; /home/ec2-user/local/bin/node /home/ec2-user/example.com/current/api.js start &> /tmp/monit.out ' timeout 30 second(s)
Stop program = '/bin/su -c /home/ec2-user/local/bin/node /home/ec2-user/example.com/current/api.js stop' timeout 30 second(s)
Existence = if Does not exist 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert
Pid = if changed 1 times within 1 cycle(s) then alert
Ppid = if changed 1 times within 1 cycle(s) then alert
System Name = system_ip-xx-xx-xx-xx.ec2.internal
Monitoring mode = active
以上是大佬教程为你收集整理的linux – monit从启动程序命令中删除引号全部内容,希望文章能够帮你解决linux – monit从启动程序命令中删除引号所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。