Skip to content

Commit

Permalink
kill dleyna service at shutdown
Browse files Browse the repository at this point in the history
prevents 2min hang if dleyna service is stale.

intel/dleyna-renderer#164 (comment)
  • Loading branch information
lalmeras committed Feb 27, 2021
1 parent 24f8f1b commit 6901739
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tasks/dleyna.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---

- file:
path: "{{ '~' | expanduser }}/.config/systemd/user"
state: directory

# dleyna process can hang computer shutdown
# https://github.com/intel/dleyna-renderer/issues/164#issuecomment-616061467
- copy:
dest: "{{ '~' | expanduser }}/.config/systemd/user/dleyna-renderer-service-kill.service"
content: |
[Unit]
Description=Kills the dleyna-rednerer-service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStop=/usr/bin/killall -9 dleyna-renderer-service
[Install]
WantedBy=graphical-session.target
register: dleyna_service

- systemd:
name: dleyna-renderer-service-kill
enabled: true
daemon_reload: "{{ dleyna_service.changed }}"
scope: user

- systemd:
name: dleyna-renderer-service-kill
state: started
scope: user
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---

- import_tasks: dleyna.yml
when: ansible_distribution == 'Fedora'

- import_role:
name: powo.rpmfusion
when: ansible_os_family == 'RedHat'
Expand Down

0 comments on commit 6901739

Please sign in to comment.