From 2b6f42c387cc02477887e26a243a22db2fbd8b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20Ho=CC=88rberg?= Date: Wed, 5 Aug 2015 12:39:52 +0200 Subject: [PATCH] Improved upstart script Don't use start-stop-daemon, upstart takes care of PID tracking Use upstart's built in logging Run as nobody, no privileges are required Remove superfluous comments --- extras/pivotal_agent-upstart.conf | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/extras/pivotal_agent-upstart.conf b/extras/pivotal_agent-upstart.conf index 382e870..6de09d2 100644 --- a/extras/pivotal_agent-upstart.conf +++ b/extras/pivotal_agent-upstart.conf @@ -1,29 +1,9 @@ -# -# This is provided as an example of a Ubuntu style upstart script -# You'll want to give it a more useful name -# -# pivotal_agent - myservice job file - description "Pivotal Monitoring Agent for New Relic" author "Pivotal - https://github.com/gopivotal/newrelic_pivotal_agent/" - -# Change this to the user running the agent -env USER=sysadmin - -# When to start the service start on runlevel [2345] - -# When to stop the service stop on runlevel [016] - -# Automatically restart process if crashed respawn - -# Run before process -pre-start script - [ -d /var/log/pivotal_agent ] || mkdir -p /var/log/pivotal_agent -end script - -# This assumes that start-stop-daemon is present on the system -# Change this to the path where pivotal_agent is located -exec start-stop-daemon --start --make-pidfile --pidfile /var/run/pivotal_agent.pid --chuid $USER --exec /opt/newrelic_pivotal_agent/pivotal_agent +setuid nobody +setgid nogroup +console log +exec /opt/newrelic_pivotal_agent/pivotal_agent