Skip to content

Instantly share code, notes, and snippets.

@skeeet
Last active Dec 27, 2015
Embed
What would you like to do?
##----description "MongoDB Monitoring Service (MMS) Agent"
##Put that in /etc/init/mms-agent.conf, and you should be able to do normal things like:
##service mms-agent start
##service mms-agent stop
##service mms-agent status
##maybe you'll need
##ln -s /lib/init/upstart-job /etc/init.d/mms-agent
####---------------------------
# Ubuntu upstart file at /etc/init/mms-agent.conf
pre-start script
mkdir -p /var/log/mms-agent/
end script
post-stop script
echo "$(date +'%Y-%m-%d %T,000') INFO mms-agent stopped" >> /var/log/mms-agent/agent.log
end script
start on runlevel [2345]
stop on runlevel [06]
#setuid nobody
#setgid nogroup
exec nohup /usr/bin/env python /opt/mms-agent/agent.py >> /var/log/mms-agent/agent.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment