मैं मॉनीट स्टार्ट/स्टॉप प्रोग्राम स्टेटमेंट डिबग कर रहा हूं। मेरी /etc/monit.conf
फ़ाइल में, मेरा start program
बयान इस तरह दिखता है:मोनिट प्रारंभ प्रोग्राम कमांड से उद्धरण हटा देता है
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 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 node
चलाता हूं, तो यह अलग-अलग आदेश प्रदर्शित करता है, समान exce भीतरी एकल उद्धरण के साथ pt हटाया:
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
मैं monit दस्तावेज में इस बारे में कुछ भी नहीं मिल रहा। प्रलेखन here परम संदर्भ प्रतीत होता है लेकिन स्रोत कोड के माध्यम से जाने से कम, मुझे यकीन नहीं है कि आगे क्या करना है।
मेरा आदेश उद्धरण के बिना पूरी तरह से काम करता है, इसलिए मुझे बस इस समस्या को ठीक करने की आवश्यकता है। सभी विचारों और संभावित सुधारों का स्वागत है।
एकल उद्धरण भागने काम नहीं करता है – dubeegee