From 54f679fb4d7ff93a9f11564c6f5f8b734e8ef471 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 10 Jan 2021 05:20:50 +0100 Subject: [PATCH] make vncserver xsession work --- tasks/vnc.yaml | 8 +++++++- templates/vnc/Xvnc-session.j2 | 5 +++++ templates/vnc/vncserver.service.j2 | 6 +++--- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 templates/vnc/Xvnc-session.j2 diff --git a/tasks/vnc.yaml b/tasks/vnc.yaml index 072b42f..434fb9f 100644 --- a/tasks/vnc.yaml +++ b/tasks/vnc.yaml @@ -39,6 +39,12 @@ - name: Xvnc-session script template: - src: x11/xsessionrc.j2 + src: vnc/Xvnc-session.j2 dest: ~/.vnc/Xvnc-session mode: 0755 + +- name: vnc xsession script + template: + src: x11/xsession.j2 + dest: ~/.vnc/xsession + mode: 0755 diff --git a/templates/vnc/Xvnc-session.j2 b/templates/vnc/Xvnc-session.j2 new file mode 100644 index 0000000..2598257 --- /dev/null +++ b/templates/vnc/Xvnc-session.j2 @@ -0,0 +1,5 @@ +#!/bin/sh + +{{ansible_managed|comment}} + +exec /etc/X11/Xsession ~/.vnc/xsession diff --git a/templates/vnc/vncserver.service.j2 b/templates/vnc/vncserver.service.j2 index ebfdacf..de2fabe 100644 --- a/templates/vnc/vncserver.service.j2 +++ b/templates/vnc/vncserver.service.j2 @@ -15,13 +15,13 @@ # `systemctl --user enable vdesk@:.service` [Unit] -Description=vdesk service - display %i +Description=vncserver service - display %i After=syslog.target network.target [Service] Type=forking -ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' -ExecStart=/bin/sh -c "/usr/bin/vncserver %i" +ExecStartPre=/usr/bin/vncserver -kill %i +ExecStart=/usr/bin/vncserver %i ExecStop=/usr/bin/vncserver -kill %i [Install]