[email protected] profile.d / systemctl start vsftpd.service Failed to get D Bus connection: Operation not permitted [email protected] profile.d / T...">

当前位置:网站首页>Running the service with systemctl in the container reports an error: failed to get D-Bus connection: operation not permitted (solution)

Running the service with systemctl in the container reports an error: failed to get D-Bus connection: operation not permitted (solution)

2022-07-06 17:59:00 Dontla

[[email protected] profile.d]# systemctl start vsftpd.service
Failed to get D-Bus connection: Operation not permitted
[[email protected] profile.d]# 

The analysis reason :
Docker The design idea is that there is no background service running in the container , The container itself is an independent master process on the host , It can also be indirectly understood as the application process running the service in the container . The life cycle of a container exists around the main process , So the right way to use the container is to run the service in the foreground .
Again systemd, This suite has become mainstream Linux Distribution version ( such as CentOS7、Ubuntu14+) Default service management , Instead of the traditional SystemV Style service management .systemd Maintenance system service program , It needs privileges to access Linux kernel . And the container is not a complete operating system , There's only one file system , And the default startup is only for ordinary users Linux kernel , That is, no privilege , So of course it doesn't work !
therefore , Follow the container design principles , Running a front desk service in a container !
Reference article :docker Problems arise :Failed to get D-Bus connection: Operation not permitted Solution

resolvent :
need --privileged And /usr/sbin/init Parameters are used together

Reference article : How to run the container in privileged mode

原网站

版权声明
本文为[Dontla]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061000528778.html