root@1733a8f48e41:# systemctl
System has not been booted with systemd as init system (PID 1). Can't operate.
重启一个docker,后台运行:
#: docker run -itd --privileged=true --name s3fd-v2 -p 8080:8080 03f6b13a5450 /sbin/init
然后运行exec进入docker:
docker exec -it s3fd-v2
/bin/bash
容器执行systemctl
参考文献:
https://www.cnblogs.com/infoo/p/11900607.html
http://wiki.lwwhome.cn/?p=690
Docker systemctl 不能使用 System has not been booted with systemd as init system (PID 1). Can‘t operate.
root@1733a8f48e41:# systemctlSystem has not been booted with systemd as init system (PID 1). Can't operate.重启一个docker,后台运行:#: docker run -itd --privileged=true --name s3fd-v2 -p 8080:8080 03f6b13a5450 /sbin/init然后运行exec进入docker:docker exec -it s3
[root@d7a74069b83c yum.repos.d]# sys
te
m
ctl
status firewalld
Sys
te
m has not been
boot
ed
with
systemd
as
init
sys
te
m (
PID
1). Can't
opera
te
.
Fail
ed
to connect to bus: Host is down
solution:
启动容器时加入参数 --privileg
ed
..
Sys
te
m has not been
boot
ed
with
systemd
as
init
sys
te
m (
PID
1). Can‘t
opera
te
.问题解决方法
用window10下WSL
使用
Ubuntu来用
Docker
当我
使用
命令sudo sys
te
m
ctl
start
docker
的时候报错:
Sys
te
m has not been
boot
ed
with
systemd
as
init
sys
te
m (
PID
1). Can't
opera
te
.
查了原因:
如果是一般的
Linux
操作系统,可能是因为
Linux
中没有
使用
systemd
,想用
systemd
命令来管理
Linux
上的服务,因此会报错,很可能是
使用
的是经典的SysV
init
(sysv
init
)系.
在用
docker
容器创建的openEuler-20.03-lts操作系统上
使用
sys
te
m
ctl
指令,显示如下信息:
Sys
te
m has not been
boot
ed
with
systemd
as
init
sys
te
m (
PID
1). Can’t
opera
te
.
Fail
ed
to connect to bus: Host is down
这是因为创建容器的时候没有特殊(真正root)权限以及相应初始化程序。
保存当前容器(如果需要的话)
docker
commi
出现这些错误的原因是我这个系统里没有
使用
sys
te
m
ctl
、service来管理ssh服务,很好理解。
最后成功
使用
如下命令进行了重启:
$ /etc/
init
.d/ssh restart
Done!!!
容器内
使用
sys
te
m
ctl
命令时出现(Sys
te
m has not been
boot
ed
with
systemd
as
init
sys
te
m (
PID
1). Can't
opera
t....信息。
解决方案:/sbin/
init
例如:Centos8
docker
run -itd --name centos --privileg
ed
=true centos /sbin/
init
docker
exec -it centos /bin/bash
注意:--privilag
ed
=true一
sys
te
m.invalid
opera
tionexception: fail
ed
to set version to
docker
-desktop: exit code: -1
Docker systemctl 不能使用 System has not been booted with systemd as init system (PID 1). Can‘t operate.
11478
Docker systemctl 不能使用 System has not been booted with systemd as init system (PID 1). Can‘t operate.
yarn install报错及解决办法
BLUE934:
中国联通开源AI平台 CubeAI智立方-AI模型库(本人微信号:yudajiangshan)
Hello_Bytes:
Docker unbuntu使用opencv-python报错ImportError: libGL.so.1和 libgthread-2.0.so.0
小扒菜同学:
Docker systemctl 不能使用 System has not been booted with systemd as init system (PID 1). Can‘t operate.
不会再变le: