From 36a9734e1914e08351d5150cb3fbfe0d51553dad Mon Sep 17 00:00:00 2001 From: José Bollo Date: Wed, 28 Feb 2018 19:28:27 +0100 Subject: weston-init: Ensure setting of the user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user was not set to the expected value because the patched file had not indication of user. This fix enforce the setting of the user. It also enforce the setting of the group. Bug-AGL: SPEC-546 Change-Id: I929bfa17c541c5334f463cd8cb3566dc5b53b408 Signed-off-by: José Bollo --- meta-agl/recipes-graphics/wayland/weston-init.bbappend | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta-agl/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/recipes-graphics/wayland/weston-init.bbappend index 01984a13c..1ca63b5de 100644 --- a/meta-agl/recipes-graphics/wayland/weston-init.bbappend +++ b/meta-agl/recipes-graphics/wayland/weston-init.bbappend @@ -17,7 +17,15 @@ do_install_append() { sed -i "/\[Service\]/r ${S}/weston.service.add" \ ${D}${systemd_system_unitdir}/weston.service + if ! grep -q '^Group=' ${D}${systemd_system_unitdir}/weston.service; then + sed -i "/\[Service\]/aGroup=root" ${D}${systemd_system_unitdir}/weston.service + fi + if ! grep -q '^User=' ${D}${systemd_system_unitdir}/weston.service; then + sed -i "/\[Service\]/aUser=root" ${D}${systemd_system_unitdir}/weston.service + fi + sed -e 's,User=root,User=${WESTONUSER},g' \ + -e 's,Group=root,Group=${WESTONGROUP},g' \ -e 's,ExecStart=.*,ExecStart=${WESTONSTART},g' \ -e 's,@WESTONTTY@,${WESTONTTY},g' \ -e 's,@XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \ -- cgit 1.2.3-korg