~# systemctl status docker System has not been booted with systemd as init system (PID 1). Can't operate.
时间: 2023-10-28 21:53:47 浏览: 42
这个错误提示表明您的系统未使用 systemd 作为 init 系统,因此无法使用 `systemctl` 命令管理服务。
如果您正在使用不支持 systemd 的系统(例如 CentOS 6),则可以使用 `service` 命令来管理服务,例如 `service docker status`。
如果您正在使用支持 systemd 的系统(例如 CentOS 7 或更高版本、Ubuntu 16.04 或更高版本),但 Docker 守护进程无法启动,可能是因为您的系统已损坏或出现其他问题。在这种情况下,建议您重新安装 Docker,并确保您的系统已更新到最新版本。
相关问题
sudo systemctl start docker System has not been booted with systemd as init system (PID 1). Can't operate.
这个错误信息是因为在当前系统中没有使用systemd作为init系统,而systemctl命令需要systemd来管理服务。因此,你需要使用其他方法来启动docker服务。可以尝试使用以下命令来启动docker服务:
```
sudo service docker start
```
如果你在WSL下使用systemctl命令启动服务,也会出现类似的错误。这是因为WSL并不支持systemd。你可以尝试使用以下方法来解决这个问题:
1. 使用service命令来启动服务,例如:
```
sudo service docker start
```
2. 在WSL中使用docker-desktop,它可以在Windows主机上运行docker服务,并通过WSL访问它。你可以在Microsoft Store中下载并安装docker-desktop。
希望这些方法可以帮助你解决问题。如果你还有其他问题,请随时提出。
docker systemctl System has not been booted with systemd as init system (PID 1). Can't operate
引用:当使用命令systemctl时,报错信息为"System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down"。
这个错误意味着docker容器内的操作系统没有使用systemd作为初始化系统(PID 1)。在这种情况下,systemctl命令无法正常工作。
解决这个问题的方式是在docker容器内使用一个PID为1的init系统,例如使用supervisord或runit作为init系统。这样就可以正常使用systemctl命令了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [docker报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.](https://blog.csdn.net/mouday/article/details/128449952)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Docker: System has not been booted with systemd as init system (PID 1). Can‘t operate.](https://blog.csdn.net/m0_46304383/article/details/121483556)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]