sailfishos-open / waydroid

Waydroid packaging for Sailfish OS
34 stars 8 forks source link

Need to comment apparmor in /var/lib/waydroid/lxc/waydroid/config #30

Closed 0312birdzhang closed 2 months ago

0312birdzhang commented 2 months ago

Otherwise waydroid-container will not start.

(010160) [16:01:21] WayDroid container is 
(010163) [16:01:21] % lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k
lxc-stop: waydroid: ../src/lxc/confile.c: set_config_apparmor_profile: 1651 Invalid argument - Built without AppArmor support
lxc-stop: waydroid: ../src/lxc/parse.c: lxc_file_for_each_line_mmap: 129 Failed to parse config file "/var/lib/waydroid/lxc/waydroid/config" at line "lxc.apparmor.profile = unconfined"
Failed to load config for waydroid
lxc-stop: waydroid: ../src/lxc/tools/lxc_stop.c: main: 143 Error opening container
(010163) [16:01:21] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(010163) [16:01:21] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log
(010163) [16:01:21] ERROR: Command failed: % lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k
(010163) [16:01:21] See also: <https://github.com/waydroid>
(010163) [16:01:21] Traceback (most recent call last):
  File "/opt/waydroid/tools/__init__.py", line 70, in main
    actions.container_manager.stop(args)
  File "/opt/waydroid/tools/actions/container_manager.py", line 158, in stop
    helpers.lxc.stop(args)
  File "/opt/waydroid/tools/helpers/lxc.py", line 340, in stop
    tools.helpers.run.user(args, command)
  File "/opt/waydroid/tools/helpers/run.py", line 58, in user
    return tools.helpers.run_core.core(args, msg, cmd, working_dir, output,
  File "/opt/waydroid/tools/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/opt/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k

(010275) [16:02:42] WayDroid container is 
(010278) [16:02:42] % lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k
lxc-stop: waydroid: ../src/lxc/confile.c: set_config_apparmor_profile: 1651 Invalid argument - Built without AppArmor support
lxc-stop: waydroid: ../src/lxc/parse.c: lxc_file_for_each_line_mmap: 129 Failed to parse config file "/var/lib/waydroid/lxc/waydroid/config" at line "lxc.apparmor.profile = unconfined"
Failed to load config for waydroid
lxc-stop: waydroid: ../src/lxc/tools/lxc_stop.c: main: 143 Error opening container
(010278) [16:02:42] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(010278) [16:02:42] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log
(010278) [16:02:42] ERROR: Command failed: % lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k
(010278) [16:02:42] See also: <https://github.com/waydroid>
(010278) [16:02:42] Traceback (most recent call last):
  File "/opt/waydroid/tools/__init__.py", line 70, in main
    actions.container_manager.stop(args)
  File "/opt/waydroid/tools/actions/container_manager.py", line 158, in stop
    helpers.lxc.stop(args)
  File "/opt/waydroid/tools/helpers/lxc.py", line 340, in stop
    tools.helpers.run.user(args, command)
  File "/opt/waydroid/tools/helpers/run.py", line 58, in user
    return tools.helpers.run_core.core(args, msg, cmd, working_dir, output,
  File "/opt/waydroid/tools/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/opt/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k

[root@RedmiNote8 waydroid]# lxc-stop -P /var/lib/waydroid/lxc -n waydroid -k
lxc-stop: waydroid: ../src/lxc/confile.c: set_config_apparmor_profile: 1651 Invalid argument - Built without AppArmor support
lxc-stop: waydroid: ../src/lxc/parse.c: lxc_file_for_each_line_mmap: 129 Failed to parse config file "/var/lib/waydroid/lxc/waydroid/config" at line "lxc.apparmor.profile = unconfined"
Failed to load config for waydroid
lxc-stop: waydroid: ../src/lxc/tools/lxc_stop.c: main: 143 Error opening container
b100dian commented 2 months ago

I think while this is needed for existing intallations, the "correct" fix forward for this (for new installs) is to include a patch in the rpm to remove this https://github.com/waydroid/waydroid/blob/main/data/configs/config_3#L3 since all 3, 4, 5 lxc version configs are merged into one. If my rpm-fu is working I will try to do this as a PR.