openthread/environment docker rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted

孤人 提交于 2020-06-27 08:38:26

问题


I am running openthread/environment:latest docker image (as of 2019-06-15)

When starting on a fresh ubuntu 18.04 with docker 18.09 using the command

ubuntu@ip-172-31-37-198:~$ docker run -it --rm openthread/environment bash

I get the following output

  • Stopping system message bus dbus [ OK ]
  • Starting system message bus dbus [ OK ]
  • Starting enhanced syslogd rsyslogd

rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted

rsyslogd: activation of module imklog failed [v8.32.0 try http://www.rsyslog.com/e/2145 ]

Anyone knows whether this is related to ubuntu setup or the docker container or how to fix.


回答1:


Try adding the --privileged option.

For example:

docker run -it --rm --privileged openthread/environment bash



回答2:


You will also get rid of this warning if you just comment out the line

module(load="imklog")

inside your Docker container (edit /etc/rsyslog.conf).

I doubt you want to read the kernel messages inside a container ;-)




回答3:


To implement @Reto's answer, put this in your Dockerfile and you're all set:

RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf


来源:https://stackoverflow.com/questions/56609182/openthread-environment-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-km

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!