Skip to content

Commit 13c74d4

Browse files
DOMjudge teammeisterT
DOMjudge team
authored andcommitted
Use systemd to start domlogo
1 parent d5522ff commit 13c74d4

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

provision-contest/ansible/roles/domlogo/tasks/main.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@
4444
owner: domjudge
4545
group: domjudge
4646

47-
- name: Add autostart shortcuts
47+
- name: Copy domlogo systemd unit file
4848
template:
49-
src: "domjudgelogo.desktop.j2"
50-
dest: "/home/domjudge/.config/autostart/domjudgelogo.desktop"
51-
owner: domjudge
52-
group: domjudge
53-
mode: 0755
49+
src: "domlogo.service.j2"
50+
dest: "/etc/systemd/system/domlogo.service"
51+
52+
- name: Enable and start domlogo
53+
systemd:
54+
name: domlogo
55+
enabled: true
56+
state: started

provision-contest/ansible/roles/domlogo/templates/domjudgelogo.desktop.j2

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Unit]
2+
Description="DOMlogo"
3+
After=network.target
4+
5+
[Service]
6+
Type=simple
7+
8+
Environment=REQUESTS_CA_BUNDLE=/usr/local/share/ca-certificates/domserver.crt
9+
Environment=DISPLAY=:0
10+
WorkingDirectory={{ DJ_DIR }}
11+
ExecStart=/usr/bin/python3 ./domlogo.py
12+
User=domjudge
13+
14+
Restart=always
15+
RestartSec=3
16+
17+
[Install]
18+
WantedBy=graphical.target

0 commit comments

Comments
 (0)