description "Start up the Trove Guest Agent"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 2 2

exec guest-agent --config-file /etc/trove/guest-agent.conf

post-start script
    PID=`status guest-agent | grep -Eoi '([0-9]+)$' | head -n1`
    echo $PID > /var/run/guest-agent.pid
end script

post-stop script
    rm -f /var/run/guest-agent.pid
end script
