~canonical-ci-engineering/charms/trusty/core-image-publisher/trunk

« back to all changes in this revision

Viewing changes to templates/upstart.conf

  • Committer: Celso Providelo
  • Date: 2015-03-25 04:13:43 UTC
  • Revision ID: celso.providelo@canonical.com-20150325041343-jw05jaz6jscs3c8f
fork of core-image-watcher

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
description "Starts a core-image-publisher 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-image-publisher
 
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-image-publisher.py -c ${SERVICE_DIR}/core-service.conf >> logs/core-image-publisher.log 2>&1"
 
22
 
 
23
end script