Merge "weston-init: Ensure setting of the user"
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 2 Apr 2018 22:28:05 +0000 (22:28 +0000)
committerGerrit Code Review <gerrit@automotivelinux.org>
Mon, 2 Apr 2018 22:28:05 +0000 (22:28 +0000)
meta-agl/recipes-graphics/wayland/weston-init.bbappend

index 01984a1..1ca63b5 100644 (file)
@@ -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' \