Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit 2c30fc4

Browse files
committed
Add crash reporter service
1 parent 3a751de commit 2c30fc4

File tree

6 files changed

+76
-0
lines changed

6 files changed

+76
-0
lines changed

crash-reporter/files/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"port": 5004, "crash_dir": "./crashes/", "read_secret": "{{ pillar['crash-reporter']['read_secret'] }}", "write_secret": "{{ pillar['crash-reporter']['write_secret'] }}" }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Job that runs crash-reporter
3+
Requires=network-online.target
4+
5+
[Service]
6+
ExecStart={{ common.servo_home }}/crash-reporter/_venv/bin/crash_reporter
7+
Environment=HOME={{ common.servo_home }}
8+
User=servo
9+
Group=servo
10+
WorkingDirectory={{ common.servo_home }}/crash-reporter
11+
12+
[Install]
13+
WantedBy=multi-user.target

crash-reporter/init.sls

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{% from 'common/map.jinja' import common %}
2+
{% from tpldir ~ '/map.jinja' import crashreporter %}
3+
4+
include:
5+
- common
6+
- python
7+
8+
crash-reporter:
9+
virtualenv.managed:
10+
- name: /home/servo/crash-reporter/_venv
11+
- venv_bin: virtualenv-3.5
12+
- python: python3
13+
- system_site_packages: False
14+
- require:
15+
- pkg: python3
16+
- pip: virtualenv
17+
pip.installed:
18+
- pkgs:
19+
- git+https://github.com/servo/crash-reporter@{{ crashreporter.rev }}
20+
- bin_env: /home/servo/crash-reporter/_venv
21+
- upgrade: True
22+
- require:
23+
- virtualenv: crash-reporter
24+
service.running:
25+
- enable: True
26+
- name: crashreporter
27+
- require:
28+
- pip: crash-reporter
29+
- watch:
30+
- file: /home/servo/crash-reporter/config.json
31+
- file: /lib/systemd/system/crashreporter.service
32+
- pip: crash-reporter
33+
34+
/home/servo/crash-reporter/config.json:
35+
file.managed:
36+
- source: salt://{{ tpldir }}/files/config.json
37+
- template: jinja
38+
- user: servo
39+
- group: servo
40+
- mode: 644
41+
42+
/lib/systemd/system/crashreporter.service:
43+
file.managed:
44+
- source: salt://{{ tpldir }}/files/crashreporter.service
45+
- template: jinja
46+
- user: root
47+
- group: root
48+
- mode: 644
49+
- context:
50+
common: {{ common }}
51+
- require:
52+
- pip: crash-reporter
53+
- file: /home/servo/crash-reporter/config.json

crash-reporter/map.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{%
2+
set crashreporter = {
3+
'rev': 'FIXME'
4+
}
5+
%}

nginx/default

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ server {
3636
proxy_set_header X-Scheme $scheme;
3737
proxy_set_header X-Script-Name /standups;
3838
}
39+
location /crash-reporter/ {
40+
proxy_pass http://localhost:5004/;
41+
}
3942
}
4043

top.sls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ base:
3232
- nginx
3333
- salt.master
3434
- standups
35+
- crash-reporter

0 commit comments

Comments
 (0)