In current configuration containers are loaded in systemV.
Issues:
- So it is problematic to use them to check systemD services
type systemctl command does not help to verify current used init system
- In addition sudo is not available to use
For example:
[root@6092eda35ebd hpcx]# systemctl
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
[root@6092eda35ebd hpcx]# type systemctl
systemctl is hashed (/usr/bin/systemctl)
[root@6092eda35ebd hpcx]# echo $?
0
Description:
https://developers.redhat.com/blog/2014/05/05/running-systemd-within-docker-container/
Workaround:
Use --privileged
sudo docker run -it --privileged harbor.mellanox.com/swx-infra/x86_64/fedora31/builder:mofed-5.1-1.0.7.0 bash
As a result:
[root@f6c7f293ee20 hpcx]# type systemctl
systemctl is /usr/bin/systemctl
[root@f6c7f293ee20 hpcx]# sudo ls
In current configuration containers are loaded in systemV.
Issues:
type systemctlcommand does not help to verify current used init systemFor example:
[root@6092eda35ebd hpcx]# systemctl
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
[root@6092eda35ebd hpcx]# type systemctl
systemctl is hashed (/usr/bin/systemctl)
[root@6092eda35ebd hpcx]# echo $?
0
Description:
https://developers.redhat.com/blog/2014/05/05/running-systemd-within-docker-container/
Workaround:
Use
--privilegedAs a result:
[root@f6c7f293ee20 hpcx]# type systemctl
systemctl is /usr/bin/systemctl
[root@f6c7f293ee20 hpcx]# sudo ls