From ea5ea149f9a8b6c4fd51af23483a5e0a07b0138a Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Mon, 31 Jul 2017 10:38:02 +0200 Subject: [PATCH] start x@.service before xlogin@{{ vdr.user }} --- Manual.org | 17 +++++++++++++++-- roles/yavdr-xorg/tasks/setup-xorg.yml | 12 ++++++++++-- .../templates/x@service.d/xlogin.conf.j2 | 2 ++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 roles/yavdr-xorg/templates/x@service.d/xlogin.conf.j2 diff --git a/Manual.org b/Manual.org index b35f779..6568617 100644 --- a/Manual.org +++ b/Manual.org @@ -1400,16 +1400,24 @@ b'\xde\xad\xbe\xef' #+END_SRC **** setup-xorg #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/setup-xorg.yml :mkdirp yes :padline no -- name: create directory /etc/systemd/system/vdr.service.d/ +- name: create directories for systemd drop-in files file: - dest: /etc/systemd/system/vdr.service.d/ + dest: '{{ item }}' state: directory + with_items: + - /etc/systemd/system/x@.service.d/ + - /etc/systemd/system/vdr.service.d/ - name: add dependency to X-server for vdr.service using a drop-in template: src: templates/vdr-xorg.conf dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf +- name: start x@.service before xlogin@.service + template: + src: templates/x@service.d/xlogin.conf.j2 + dest: /etc/systemd/system/x@.service.d/xlogin.conf + - name: load environment file for vdr.service template: src: templates/systemd/vdr-environ.j2 @@ -1629,6 +1637,11 @@ Before=graphical.target Type=forking ExecStart=/usr/bin/x-daemon -logverbose 6 -noreset %I -config /etc/X11/xorg-debug.conf #+END_SRC +***** Drop-in snippet for x@.service +#+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/x@service.d/xlogin.conf.j2 :mkdirp yes :padline no +[Unit] +Before=xlogin@{{ vdr.user }} +#+END_SRC ***** Drop-in snippet for vdr.service #+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/vdr-xorg.conf :mkdirp yes :padline no # file: roles/yavdr-xorg/templates/vdr-xorg.conf diff --git a/roles/yavdr-xorg/tasks/setup-xorg.yml b/roles/yavdr-xorg/tasks/setup-xorg.yml index cda8132..3775dec 100644 --- a/roles/yavdr-xorg/tasks/setup-xorg.yml +++ b/roles/yavdr-xorg/tasks/setup-xorg.yml @@ -1,13 +1,21 @@ -- name: create directory /etc/systemd/system/vdr.service.d/ +- name: create directories for systemd drop-in files file: - dest: /etc/systemd/system/vdr.service.d/ + dest: '{{ item }}' state: directory + with_items: + - /etc/systemd/system/x@.service.d/ + - /etc/systemd/system/vdr.service.d/ - name: add dependency to X-server for vdr.service using a drop-in template: src: templates/vdr-xorg.conf dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf +- name: start x@.service before xlogin@.service + template: + src: templates/x@service.d/xlogin.conf.j2 + dest: /etc/systemd/system/x@.service.d/xlogin.conf + - name: load environment file for vdr.service template: src: templates/systemd/vdr-environ.j2 diff --git a/roles/yavdr-xorg/templates/x@service.d/xlogin.conf.j2 b/roles/yavdr-xorg/templates/x@service.d/xlogin.conf.j2 new file mode 100644 index 0000000..8a086c4 --- /dev/null +++ b/roles/yavdr-xorg/templates/x@service.d/xlogin.conf.j2 @@ -0,0 +1,2 @@ +[Unit] +Before=xlogin@{{ vdr.user }}