Mellanox / ci-demo

Apache License 2.0
2 stars 19 forks source link

Docker System has not been booted with systemd as init system #24

Open igor-ivanov opened 3 years ago

igor-ivanov commented 3 years ago

In current configuration containers are loaded in systemV. Issues:

  1. So it is problematic to use them to check systemD services
  2. type systemctl command does not help to verify current used init system
  3. 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

vasily-v-ryabov commented 3 years ago

For K8s cluster you can use --privileged this way globally:

kubernetes:
    privileged: true

or use key privileged: true for specified records in "runs_on_dockers" section.

igor-ivanov commented 3 years ago

Setting --privileged does not help to get booting using systemd

mike-dubman commented 3 years ago

AFAIR, active container ignores systemd. please check with @Sergey-Mamonov he solved similar issues with supervisord for collectx