~pwlars/charms/trusty/snappy-proposed-selftest-agent/core-service-conf

« back to all changes in this revision

Viewing changes to templates/upstart.conf

  • Committer: Paul Larson
  • Date: 2015-05-27 01:41:42 UTC
  • Revision ID: paul.larson@canonical.com-20150527014142-jrmxi6ulvxxulcf9
Initial fork of a charm branch with modifications for core-selftest-agent

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
description "Starts a core-selftest-agent process"
 
2
 
 
3
start on (local-filesystems and net-device-up IFACE=eth0)
 
4
stop on runlevel [!12345]
 
5
 
 
6
# use sigint so python code just needs to catch KeyboardInterrupt
 
7
kill signal SIGINT
 
8
 
 
9
# If the process quits unexpectedly trigger respawn it
 
10
respawn
 
11
# unless it fails 15 times within 5 seconds
 
12
respawn limit 15 5
 
13
 
 
14
env SERVICE_DIR=/srv/{{ environment }}/core-selftest-agent
 
15
env SERVICE_USER=core-worker
 
16
 
 
17
script
 
18
 
 
19
  install -d -o ${SERVICE_USER} ${SERVICE_DIR}/logs
 
20
  chdir ${SERVICE_DIR}
 
21
  exec sudo -u ${SERVICE_USER} sh -c "./ve/bin/python3 core-selftest-agent.py -c ${SERVICE_DIR}/core-service.conf >> logs/core-selftest-agent.log 2>&1"
 
22
 
 
23
end script