对极其不稳定的设置进行故障排除 - 使用 ubuntu-frame 的 Ubuntu kiosk

对极其不稳定的设置进行故障排除 - 使用 ubuntu-frame 的 Ubuntu kiosk

我有一组工作计算机(运行 Ubuntu 20.04),用于使用 Docker 托管各种容器化应用程序,以及使用ubuntu-frame.为了设置和配置信息亭,我们使用 Ansible - 以下是作为输入给出的 .yml 文件的内容ansible-playbook(信息亭服务应该在重新启动时重新启动)。

- name: Provision new machine
  hosts: all
  remote_user: foobar
  become: yes
  become_method: sudo
  become_user: root
  vars_files:
    - vars.yml

  tasks:
  - name: Install ubuntu-frame
    snap:
      name: ubuntu-frame
  - name: Configure ubuntu-frame
    shell:
      cmd: snap set ubuntu-frame daemon=true
  - name: Install wpe-webkit-mir-kiosk snap
    snap:
      name: wpe-webkit-mir-kiosk
  - name: Configure network connection
    shell:
      cmd: snap connect wpe-webkit-mir-kiosk:wayland
  - name: Configure kiosk
    shell:
      cmd: snap set wpe-webkit-mir-kiosk daemon=true
  - name: Set url
    shell:
      cmd: snap set wpe-webkit-mir-kiosk url=http://localhost:8080
  - name: Start kiosk
    shell:
      cmd: snap start wpe-webkit-mir-kiosk
  - name: Make sure kiosk is restarted on reboot
    shell:
      cmd: echo "SHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n@reboot root sleep 30 && snap set wpe-webkit-mir-kiosk url=http://localhost:8080 && snap start wpe-webkit-mir-kiosk" > /etc/cron.d/restart-kiosk

基本上,Docker 应用程序之一会在根路径(端口 8080 上)返回一个 HTML 文档,然后该文档会显示在连接到计算机的显示器上。对于大多数计算机来说,这一切都很好,但是对于某些计算机来说,屏幕会因以下错误而死机(显示在信息亭屏幕上):“ Page load error - message corrupt”。有时,只需通过 Ansible 使用 kiosk 设置重新配置主机即可解决该错误,有时则不然。有时,重新启动可以解决问题,但并非每次都会。

SSH:登录服务器并查看日志(/var/log/syslog),有很多记录的错误数。一般来说,它们如下所示:

Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + exec nohup /snap/ubuntu-frame/3709/bin/run-frame /snap/ubuntu-frame/3709/usr/local/bin/frame
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + [ /snap/ubuntu-frame/3709/usr/local/bin/frame = --help ]
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170658]: + dirname /run/user/0/snap.ubuntu-frame
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + XDG_RUNTIME_DIR=/run/user/0
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + export XDG_RUNTIME_DIR
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + mkdir -p /run/user/0 -m 700
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + [ -n  ]
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: + exec /snap/ubuntu-frame/3709/usr/local/bin/frame
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.402507] <information> mirserver: Starting
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.403124] < - debug - > mirserver: Using Linux VT subsystem for session management
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.403334] <information> mircommon: Loading modules from: /snap/ubuntu-frame/3709/usr/lib/x86_64-linux-gnu/mir/server-platform
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.403440] <information> mircommon: Loading module: /snap/ubuntu-frame/3709/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.403466] <information> mircommon: Loading module: /snap/ubuntu-frame/3709/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.403491] <information> mircommon: Loading module: /snap/ubuntu-frame/3709/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.404916] <information> mirserver: Found display driver: mir:gbm-kms (version 2.9.0)
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.407454] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver i915
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.407854] <information> gbm-kms: Failed to probe DRM device: /build/mir-c1eKlT/mir-2.9.0/src/server/console/linux_virtual_terminal.cpp(167): Throw in function {anonymous}::DRMDevice::DRMDevice(mir::VTFileOperations&, const char*, std::unique_ptr<mir::Device::Observer>, const std::shared_ptr<mir::LinuxVirtualTerminal::DeviceList>&)
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: Dynamic exception type: boost::wrapexcept<std::system_error>
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: std::exception::what: Failed to claim DRM master: Invalid argument
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [boost::errinfo_file_name_*] = /dev/dri/card0
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.408127] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.408362] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.408403] <information> mirserver: (Unsupported by system environment)
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.408426] <information> mirserver: Found display driver: mir:x11 (version 2.9.0)
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: [2022-09-12 08:49:28.408473] <information> mirserver: (Unsupported by system environment)
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: ERROR: /build/mir-c1eKlT/mir-2.9.0/src/server/graphics/default_configuration.cpp(233): Throw in function virtual const std::vector<std::shared_ptr<mir::graphics::DisplayPlatform> >& mir::DefaultServerConfiguration::the_display_platforms()
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: Dynamic exception type: boost::wrapexcept<std::runtime_error>
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: std::exception::what: Exception while creating graphics platform
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: ERROR: /build/mir-c1eKlT/mir-2.9.0/src/server/graphics/platform_probe.cpp(190): Throw in function std::vector<std::pair<mir::graphics::SupportedDevice, std::shared_ptr<mir::SharedLibrary> > > {anonymous}::modules_for_device({anonymous}::ModuleType, const std::vector<std::shared_ptr<mir::SharedLibrary> >&, const mir::options::ProgramOption&, const std::shared_ptr<mir::ConsoleServices>&)
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: Dynamic exception type: boost::wrapexcept<std::runtime_error>
Sep 12 08:49:28 hostname ubuntu-frame.daemon[170635]: std::exception::what: Failed to find any platforms for current system
Sep 12 08:49:28 hostname systemd[1]: snap.ubuntu-frame.daemon.service: Main process exited, code=exited, status=1/FAILURE
Sep 12 08:49:28 hostname systemd[1]: snap.ubuntu-frame.daemon.service: Failed with result 'exit-code'.

工作机器的日志示例

Sep 13 11:59:56 hostname2 cog[2715]: <http://localhost:8080/> Load started.
Sep 13 11:59:56 hostname2 cog[2715]: <http://localhost:8080/> Loading...
Sep 13 11:59:56 hostname2 kernel: [106815.347262] audit: type=1400 audit(1663070396.629:26475): apparmor="DENIED" operation="open" profile="snap.wpe-webkit-mir-kiosk.daemon" name="/proc/zoneinfo" pid=2715 comm="PressureMonitor" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 13 11:59:56 hostname2 cog[2715]: <http://localhost:8080/> Loaded successfully.
Sep 13 11:59:59 hostname2 kernel: [106817.836954] audit: type=1400 audit(1663070399.117:26476): apparmor="DENIED" operation="open" profile="snap.wpe-webkit-mir-kiosk.daemon" name="/proc/zoneinfo" pid=2715 comm="PressureMonitor" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 13 12:00:01 hostname2 cog[2715]: <http://localhost:8080/> Load started.
Sep 13 12:00:01 hostname2 cog[2715]: <http://localhost:8080/> Loading...
Sep 13 12:00:01 hostname2 kernel: [106820.438960] audit: type=1400 audit(1663070401.721:26477): apparmor="DENIED" operation="open" profile="snap.wpe-webkit-mir-kiosk.daemon" name="/proc/zoneinfo" pid=2715 comm="PressureMonitor" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 13 12:00:01 hostname2 cog[2715]: <http://localhost:8080/> Loaded successfully.
Sep 13 12:00:04 hostname2 kernel: [106823.040962] audit: type=1400 audit(1663070404.321:26478): apparmor="DENIED" operation="open" profile="snap.wpe-webkit-mir-kiosk.daemon" name="/proc/zoneinfo" pid=2715 comm="PressureMonitor" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 13 12:00:06 hostname2 cog[2715]: <http://localhost:8080/> Load started.
Sep 13 12:00:06 hostname2 cog[2715]: <http://localhost:8080/> Loading...
Sep 13 12:00:06 hostname2 kernel: [106825.644853] audit: type=1400 audit(1663070406.925:26479): apparmor="DENIED" operation="open" profile="snap.wpe-webkit-mir-kiosk.daemon" name="/proc/zoneinfo" pid=2715 comm="PressureMonitor" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 13 12:00:06 hostname2 cog[2715]: <http://localhost:8080/> Loaded successfully.
Sep 13 12:00:09 hostname2 kernel: [106828.133211] audit: type=1400 audit(1663070409.413:26480): apparmor="DENIED" operation="open" profile="snap.wpe-webkit-mir-kiosk.daemon" name="/proc/zoneinfo" pid=2715 comm="PressureMonitor" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Sep 13 12:00:11 hostname2 cog[2715]: <http://localhost:8080/> Load started.
Sep 13 12:00:11 hostname2 cog[2715]: <http://localhost:8080/> Loading...
Sep 13 12:00:11 hostname2 cog[2715]: <http://localhost:8080/> Loaded successfully.

说我不太确定我在寻找什么有点轻描淡写 - 我真的很想隔离并放大手头的实际问题,但目前我不太确定怎么做。如果我可以提供任何其他日志/配置信息,请告诉我 - 我真的很想更好地了解根本问题。

抱歉这篇文章太长了..:)

相关内容