Skip to content

Commit

Permalink
Use systemd to start domlogo
Browse files Browse the repository at this point in the history
  • Loading branch information
DOMjudge team authored and meisterT committed May 5, 2024
1 parent d5522ff commit 13c74d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
15 changes: 9 additions & 6 deletions provision-contest/ansible/roles/domlogo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@
owner: domjudge
group: domjudge

- name: Add autostart shortcuts
- name: Copy domlogo systemd unit file
template:
src: "domjudgelogo.desktop.j2"
dest: "/home/domjudge/.config/autostart/domjudgelogo.desktop"
owner: domjudge
group: domjudge
mode: 0755
src: "domlogo.service.j2"
dest: "/etc/systemd/system/domlogo.service"

- name: Enable and start domlogo
systemd:
name: domlogo
enabled: true
state: started

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description="DOMlogo"
After=network.target

[Service]
Type=simple

Environment=REQUESTS_CA_BUNDLE=/usr/local/share/ca-certificates/domserver.crt
Environment=DISPLAY=:0
WorkingDirectory={{ DJ_DIR }}
ExecStart=/usr/bin/python3 ./domlogo.py
User=domjudge

Restart=always
RestartSec=3

[Install]
WantedBy=graphical.target

0 comments on commit 13c74d4

Please sign in to comment.