Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
igor-ivanov opened this issue Mar 22, 2021 · 3 comments
Open

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

igor-ivanov opened this issue Mar 22, 2021 · 3 comments

Comments

@igor-ivanov
Copy link

igor-ivanov commented Mar 22, 2021

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
Copy link
Contributor

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
Copy link
Author

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

@mike-dubman
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants