Weston issue using systemd LS1028 as non-root user

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Weston issue using systemd LS1028 as non-root user

1,377 次查看
Shinra
Contributor II

Hi,

I'm facing an issue I've been banging my head against for the last few days. Context is the following:

We're building a kiosk application (web brower based) on a LS1028ARDB using yocto. Everything worked well as long as I was running weston using sysvinit, problems started to appear when I switched to systemd and wanted weston to run as a non-root user.

I'm using the latest yocto version available on codeaurora (# 8dae695989dee10fe8ef3ff8a2f915fdd6cb9579) on the kirkstone branch.

In my image is included: weston_10.0.0.imx and weston-init.

Current status is the following: The weston service starts at boot using a user called weston. As root I'm not able to run a weston app (like weston-flower) with the error "failed to connect to Wayland display" which is expected. When I login as weston I can run apps, but nothing will ever show on the screen.

If I manually start weston as root using "weston-launch -u root" and login again as weston my apps show on the screen.

The major difference is that weston, when launched with systemd, is using logind. Where starting weston with weston-launch uses the legacy "weston_launch launcher". weston-launch is deprecated and definitely not the future, I want to avoid using it.

A journalctl on the weston service reveals:

root@ls1028ardb:~# journalctl _PID=653
Nov 08 14:09:31 ls1028ardb systemd[653]: pam_unix(weston-autologin:session): session opened for user weston(uid=1000) by weston(uid=0)
Nov 08 14:09:31 ls1028ardb audit[653]: SYSCALL arch=c00000b7 syscall=64 success=yes exit=4 a0=8 a1=ffffce22cc30 a2=4 a3=ffffbbb706c0 items=0 ppid=1 pid=653 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty7 ses=4 comm="(weston)" exe="/lib/systemd/systemd" key=(null)
Nov 08 14:09:31 ls1028ardb weston[653]: Date: 2022-11-08 UTC
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] weston 10.0.0
Nov 08 14:09:31 ls1028ardb weston[653]:                https://wayland.freedesktop.org
Nov 08 14:09:31 ls1028ardb weston[653]:                Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Nov 08 14:09:31 ls1028ardb weston[653]:                Build: 10.0.0
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] Command line: /usr/bin/weston --modules=systemd-notify.so
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] OS: Linux, 5.15.32+gfa6c3168595c, #1 SMP PREEMPT Tue Jun 7 02:34:46 UTC 2022, aarch64
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] Flight recorder: enabled
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] Using config file '/etc/xdg/weston/weston.ini'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] Output repaint window is 7 ms maximum.
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.534] Loading module '/usr/lib/libweston-10/drm-backend.so'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.538] initializing drm backend
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.538] Trying logind launcher...
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.547] logind: session control granted
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.554] using /dev/dri/card1
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.554] DRM: supports atomic modesetting
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.554] DRM: supports GBM modifiers
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.554] DRM: supports picture aspect ratio
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.554] Loading module '/usr/lib/libweston-10/gl-renderer.so'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.560] EGL client extensions: EGL_EXT_client_extensions
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_platform_base EGL_KHR_platform_wayland
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_platform_wayland EGL_EXT_device_query
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_device_drm EGL_EXT_device_drm_render_node
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_platform_gbm
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.562] EGL device extensions: EGL_EXT_client_extensions
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_platform_base EGL_KHR_platform_wayland
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_platform_wayland EGL_EXT_device_query
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_device_drm EGL_EXT_device_drm_render_node
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_platform_gbm
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.562] EGL version: 1.5
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.562] EGL vendor: Vivante Corporation
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.562] EGL client APIs: OpenGL_ES
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.562] EGL extensions: EGL_KHR_fence_sync EGL_KHR_reusable_sync
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_wait_sync EGL_KHR_image EGL_KHR_image_base
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_image_dma_buf_import
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_lock_surface
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_create_context EGL_KHR_no_config_context
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_surfaceless_context EGL_KHR_get_all_proc_addresses
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_create_context_robustness EGL_EXT_protected_surface
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_protected_content EGL_EXT_buffer_age
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_ANDROID_native_fence_sync EGL_WL_bind_wayland_display
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_WL_create_wayland_buffer_from_image EGL_KHR_partial_update
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_EXT_swap_buffers_with_damage
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.562] EGL_KHR_surfaceless_context available
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.566] GL version: OpenGL ES 3.1 V6.4.3.p4.398061
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.566] GLSL version: OpenGL ES GLSL ES 3.10
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.566] GL vendor: Vivante Corporation
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.567] GL renderer: Vivante GC7000UL
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.567] GL extensions: GL_OES_vertex_type_10_10_10_2
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_vertex_half_float GL_OES_element_index_uint
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_mapbuffer GL_OES_vertex_array_object
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_compressed_ETC1_RGB8_texture
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_compressed_paletted_texture GL_OES_texture_npot
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_rgb8_rgba8 GL_OES_depth_texture
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_depth32
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_packed_depth_stencil GL_OES_fbo_render_mipmap
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_get_program_binary GL_OES_fragment_precision_high
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_standard_derivatives GL_OES_EGL_image
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_EGL_sync GL_OES_texture_stencil8
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_shader_image_atomic
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_texture_storage_multisample_2d_array
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_required_internalformat GL_OES_surfaceless_context
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_draw_buffers_indexed GL_OES_texture_border_clamp
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_texture_buffer GL_OES_texture_cube_map_array
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_draw_elements_base_vertex GL_OES_texture_half_float
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_OES_texture_float GL_KHR_blend_equation_advanced
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_KHR_debug GL_KHR_robustness
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_KHR_robust_buffer_access_behavior
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_texture_type_2_10_10_10_REV
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_texture_compression_s3tc GL_EXT_read_format_bgra
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_multi_draw_arrays GL_EXT_frag_depth
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_discard_framebuffer GL_EXT_blend_minmax
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_multisampled_render_to_texture
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_robustness GL_EXT_texture_sRGB_decode
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_draw_buffers_indexed GL_EXT_texture_border_clamp
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_texture_buffer GL_EXT_texture_cube_map_array
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_multi_draw_indirect GL_EXT_draw_elements_base_vertex
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_texture_rg GL_EXT_protected_textures GL_EXT_sRGB
Nov 08 14:09:31 ls1028ardb weston[653]:                GL_EXT_unpack_subimage GL_VIV_direct_texture
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.602] GL ES 3.1 - renderer features:
Nov 08 14:09:31 ls1028ardb weston[653]:                read-back format: BGRA
Nov 08 14:09:31 ls1028ardb weston[653]:                EGL Wayland extension: yes
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.613] event0  - not using input device '/dev/input/event0'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.643] event1  - not using input device '/dev/input/event1'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.744] event2  - not using input device '/dev/input/event2'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.856] event3  - not using input device '/dev/input/event3'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.857] warning: no input devices on entering Weston. Possible causes:
Nov 08 14:09:31 ls1028ardb weston[653]:         - no permissions to read /dev/input/event*
Nov 08 14:09:31 ls1028ardb weston[653]:         - seats misconfigured (Weston backend option 'seat', udev device property ID_SEAT)
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.857] failed to create input devices
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.858] DRM: head 'DP-1' updated, connector 56 is connected, EDID make 'IVM', model 'PLT1015     ', serial '50294'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.858] DRM: head 'DP-1' found, connector 56 is connected, EDID make 'IVM', model 'PLT1015     ', serial '50294'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.859] Registered plugin API 'weston_drm_output_api_v1' of size 24
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.859] Color manager: no-op
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.859] Module '/usr/lib/libgbm.so' already loaded
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.859] Output 'DP-1' using color profile: built-in default sRGB SDR profile
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.860] Chosen EGL config details: id:  31 rgba: 8 8 8 8 buf: 32 dep:  0 stcl: 0 int: 1-60 type: win|pix|pbf|swap_preserved vis_id: ARGB8888 (0x34325241)
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.860] Output DP-1 (crtc 48) video modes:
Nov 08 14:09:31 ls1028ardb weston[653]:                1920x1080@60.0, current, 172.8 MHz
Nov 08 14:09:31 ls1028ardb weston[653]:                1280x720@60.0, 74.2 MHz
Nov 08 14:09:31 ls1028ardb weston[653]:                1280x720@60.0 16:9, 74.2 MHz
Nov 08 14:09:31 ls1028ardb weston[653]:                720x480@59.9 4:3, 27.0 MHz
Nov 08 14:09:31 ls1028ardb weston[653]:                720x480@59.9 16:9, 27.0 MHz
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.860] Output 'DP-1' enabled with head(s) DP-1
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.860] Compositor capabilities:
Nov 08 14:09:31 ls1028ardb weston[653]:                arbitrary surface rotation: yes
Nov 08 14:09:31 ls1028ardb weston[653]:                screen capture uses y-flip: yes
Nov 08 14:09:31 ls1028ardb weston[653]:                cursor planes: yes
Nov 08 14:09:31 ls1028ardb weston[653]:                arbitrary resolutions: no
Nov 08 14:09:31 ls1028ardb weston[653]:                view mask clipping: yes
Nov 08 14:09:31 ls1028ardb weston[653]:                explicit sync: yes
Nov 08 14:09:31 ls1028ardb weston[653]:                color operations: no
Nov 08 14:09:31 ls1028ardb weston[653]:                presentation clock: CLOCK_MONOTONIC, id 1
Nov 08 14:09:31 ls1028ardb weston[653]:                presentation clock resolution: 0.000000001 s
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.860] Loading module '/usr/lib/weston/kiosk-shell.so'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.861] Warning: support for deprecated wl_shell interface is enabled. Please migrate legacy clients to xdg-shell.
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.861] Loading module '/usr/lib/weston/systemd-notify.so'
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.861] info: add 1 socket(s) provided by systemd
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.892] atomic: couldn't commit new state: Permission denied
Nov 08 14:09:31 ls1028ardb weston[653]: [14:09:31.892] repaint-flush failed: No such file or directory
Nov 08 14:09:55 ls1028ardb weston[653]: [14:09:55.895] atomic: couldn't commit new state: Permission denied
Nov 08 14:09:55 ls1028ardb weston[653]: [14:09:55.895] repaint-flush failed: No such file or directory
Nov 08 14:09:59 ls1028ardb weston[653]: [14:09:59.127] atomic: couldn't commit new state: Permission denied
Nov 08 14:09:59 ls1028ardb weston[653]: [14:09:59.127] repaint-flush failed: No such file or directory

First there's the issue with the input devices, but let's ignore that part for now. The real issue in my opinion are the lines at the end: atomic: and repaint-flush failed:. Seems like a permission issue to me, but I have no clue about where.

Regarding the input devices, I guess I could add a udev rule to assign them to the seat0.

loginctl confirms that a seat was attributed to weston:

root@ls1028ardb:~# loginctl 
SESSION  UID USER   SEAT  TTY  
     c2    0 root         ttyS0
     c3 1000 weston seat0 tty7

2 sessions listed.

If anyone has any clue about what is going on I would be very thankful.

Regards
Pierre

0 项奖励
回复
1 回复

1,364 次查看
yipingwang
NXP TechSupport
NXP TechSupport
0 项奖励
回复