monit 시작/중지 프로그램 명령문을 디버깅합니다. 내 /etc/monit.conf
파일에서 내 start program
문은 다음과 같습니다monit 시작 프로그램 명령에서 따옴표를 제거합니다.
Starting nodejs daemon...
nodejs daemon started. PID: 16408
: 나는
$ 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
파일의 올바른 출력을 반환 실행하는 쉘에서 테스트했습니다
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'""
그러나 sudo monit -v monitor node
을 실행하면 다른 명령, 동일한 exce가 표시됩니다. 내부 따옴표와 PT는을 제거 : 나는 MONIT 문서에서 이것에 대해 아무것도 찾을 수 없습니다
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
. 문서 here은 궁극적 인 참고 자료로 보이지만 소스 코드를 살펴 보지 못하면 다음에 무엇을해야할지 모르겠습니다.
내 명령은 따옴표를 제거하지 않고도 완벽하게 작동하므로이 문제를 해결하면됩니다. 모든 아이디어와 가능한 수정 사항이 환영됩니다.
작은 따옴표 이스케이프가 작동하지 않음 – dubeegee