0

我在 CentOS7 上配置了我的第一个 lxc 容器。
当我启动容器时,一切正常

1 ) 当我在容器内发送 init 6 时,出现以下错误:

Could not unmount /dev/ptmx: Device or resource busy
Could not unmount /dev/ptmx: Device or resource busy
Cannot finalize remaining file systems and devices, giving up.

2)在消息日志中:

Oct 15 07:37:56  systemd-sysctl: Failed to write '4294967295' to '/proc/sys/kernel/shmmax': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '268435456' to '/proc/sys/kernel/shmall': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '16' to '/proc/sys/kernel/sysrq': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '1' to '/proc/sys/kernel/core_uses_pid': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '1' to '/proc/sys/net/ipv4/conf/default/rp_filter': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '0' to '/proc/sys/net/ipv4/conf/default/accept_source_route': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '1' to '/proc/sys/fs/protected_hardlinks': Read-only file system
Oct 15 07:37:56  systemd-sysctl: Failed to write '1' to '/proc/sys/fs/protected_symlinks': Read-only file system
Oct 15 07:37:56  systemd: Started Dynamic System Tuning Daemon.
Oct 15 07:37:56  tuned: Exception in thread Thread-2:
Oct 15 07:37:56  tuned: Traceback (most recent call last):
Oct 15 07:37:56  tuned: File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
Oct 15 07:37:56  tuned: self.run()
Oct 15 07:37:56  tuned: File "/usr/lib64/python2.7/threading.py", line 764, in run
Oct 15 07:37:56  tuned: self.__target(*self.__args, **self.__kwargs)
Oct 15 07:37:56  tuned: File "/usr/lib/python2.7/site-packages/tuned/daemon/daemon.py", line 82, in _thread_code
Oct 15 07:37:56  tuned: self._unit_manager.create(self._profile.units)
Oct 15 07:37:56  tuned: File "/usr/lib/python2.7/site-packages/tuned/units/manager.py", line 62, in create
Oct 15 07:37:56  tuned: plugin.initialize_instances()
Oct 15 07:37:56  tuned: File "/usr/lib/python2.7/site-packages/tuned/plugins/base.py", line 101, in initialize_instances
Oct 15 07:37:56  tuned: self._instance_init(instance)
Oct 15 07:37:56  tuned: File "/usr/lib/python2.7/site-packages/tuned/plugins/plugin_cpu.py", line 81, in _instance_init
Oct 15 07:37:56  tuned: self._cpu_latency_fd = os.open("/dev/cpu_dma_latency", os.O_WRONLY)
Oct 15 07:37:56  tuned: OSError: [Errno 2] No such file or directory: '/dev/cpu_dma_latency'
Oct 15 07:37:56  network: Bringing up loopback interface:  [  OK  ]
Oct 15 07:37:58  network: Bringing up interface eth0:  [  OK  ]
Oct 15 07:37:58  systemd-sysctl: Failed to write '4294967295' to '/proc/sys/kernel/shmmax': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '268435456' to '/proc/sys/kernel/shmall': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '16' to '/proc/sys/kernel/sysrq': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '1' to '/proc/sys/kernel/core_uses_pid': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '1' to '/proc/sys/net/ipv4/conf/default/rp_filter': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '0' to '/proc/sys/net/ipv4/conf/default/accept_source_route': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '1' to '/proc/sys/fs/protected_hardlinks': Read-only file system
Oct 15 07:37:58  systemd-sysctl: Failed to write '1' to '/proc/sys/fs/protected_symlinks': Read-only file system
kdumpctl: Error: /boot/vmlinuz-3.10.0-123.8.1.el7.x86_64 not found.
kdumpctl: Starting kdump: [FAILED]

我不明白它是 lxc 容器的关键信息吗?
有人可以告诉我如何解决这些错误吗?

4

1 回答 1

1

LXC 容器具有与主机相同的内核。因此,出于安全原因,禁止访客通过 proc/sys 文件系统更改内核参数

尽管出现此错误,客人应该可以正常启动

于 2014-12-04T13:32:23.993 回答