monit - upstart script for logstash, writing the pid file that deals with the fork -
i using example upstart script logstash having trouble writing pid file monit use @ /var/run/logstash.pid
when use "echo $$ > /var/run/logstash.pid" writes wrong pid value file, think value before fork. there solution this?
# logstash - agent instance # description "logstash agent instance" start on virtual-filesystems stop on runlevel [06] # respawn if process exits respawn respawn limit 5 30 limit nofile 65550 65550 expect fork # need chdir somewhere writable because logstash needs unpack few # temporary files on startup. chdir /home/logstash script # runs logstash agent 'logstash' user echo $$ > /var/run/logstash.pid su -s /bin/sh -c 'exec "$0" "$@"' logstash -- /usr/bin/java -jar logstash.jar agent -f /etc/logstash/agent.conf --log /var/log/logstash.log & emit logstash-agent-running end script
Comments
Post a Comment