Skip to content

Commit

Permalink
Use systemd to start domlogo (#135)
Browse files Browse the repository at this point in the history
* Use systemd to start domlogo

* Update provision-contest/ansible/roles/domlogo/templates/domlogo.service.j2

Co-authored-by: MCJ Vasseur <[email protected]>

---------

Co-authored-by: DOMjudge team <[email protected]>
Co-authored-by: MCJ Vasseur <[email protected]>
  • Loading branch information
3 people authored May 12, 2024
1 parent 0327278 commit d9e0d29
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=domlogo.py
User=domjudge

Restart=always
RestartSec=3

[Install]
WantedBy=graphical.target

0 comments on commit d9e0d29

Please sign in to comment.