~thomir-deactivatedaccount/charms/trusty/tanuki-result-enum-api/charm-remove-nagios-checks

« back to all changes in this revision

Viewing changes to templates/upstart.conf

Use setuid and setgid instead of sudo in the upstart template [r=Celso Providelo]

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
respawn
11
11
# unless it fails 15 times within 5 seconds
12
12
respawn limit 15 5
 
13
# set uid and gid 
 
14
setuid www-data
 
15
setgid www-data
13
16
 
14
 
env SERVICE_DIR=/srv/{{ environment }}/result-enum-api
 
17
env LOG_DIR=/srv/result-enum-api/{{ environment }}/logs
 
18
env SERVICE_DIR=/srv/result-enum-api/{{ environment }}/result-enum-api
15
19
 
16
20
script
17
21
 
18
22
  chdir ${SERVICE_DIR}
19
23
 
20
 
  exec sudo -u www-data ./ve/bin/gunicorn \
 
24
  exec ./ve/bin/gunicorn \
21
25
    --name=result-enum-api \
22
26
    --bind=0.0.0.0 \
23
 
    --log-file=${SERVICE_DIR}/logs/gunicorn.log \
 
27
    --log-file=${LOG_DIR}/gunicorn.log \
24
28
    --log-level=INFO \
25
 
    --access-logfile=${SERVICE_DIR}/logs/access.log \
 
29
    --access-logfile=${LOG_DIR}/access.log \
26
30
    result_enum_api:app
27
31
 
28
32
end script