You are not logged in.

#1 2021-06-26 22:58:01

mjandrews
Member
From: Nottingham, UK
Registered: 2013-03-26
Posts: 17

Arch Linux based Docker container: System not booted with systemd err

(apologies if this is not appropriate in the "Networking, Server, and Protection" category. It is about running a Arch Linux based Docker container, which I figure is in a sense related to running a Arch Linux server).

I am trying to run the RStudio server inside an Arch Linux based Docker container. To my surprise, I have got it to work. However, I have encountered an error that I don't understand.
It turns out it is simple to reproduce from the the base Arch Linux Docker image.

# run the archlinux Docker container
docker run -it archlinux/archlinux:latest 

# in the bash terminal, type `timedatectl`
[root@00ce15b7997d /]# timedatectl
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

If I, or more to the point, some app (like an R command running in RStudio) needed to use timedatectl, this error will occur.

I understand that the systemd will not, and should not, run inside a Docker container. But I assume from the above error, that some process are relying on systemd (maybe?).

What, if anything, should be done about this problem?

Offline

#2 2021-06-27 10:56:21

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: Arch Linux based Docker container: System not booted with systemd err

$ pkgfile timedatectl
core/systemd
$ 
$ pacman -Ql systemd | grep /usr/bin -wc
48
$ 

But I assume from the above error, that some process are relying on systemd (maybe?).

Some is an understatement.


Time synchronization should be setup on the host, why would an application need to know about it ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-06-28 14:48:39

mjandrews
Member
From: Nottingham, UK
Registered: 2013-03-26
Posts: 17

Re: Arch Linux based Docker container: System not booted with systemd err

Lone_Wolf wrote:

Time synchronization should be setup on the host, why would an application need to know about it ?

Looking into it further, an R package in RStudio queries timedatectl, and that leads to the error message. I think there are workarounds, e.g. using environmental variables, so that the R package does not need to do this.

As a more general point, and this is probably just something I need to learn more about, I am still confused about the use of systemd and Docker containers. For example, when I run RStudio server on an Arch based Linux server, I use systemctl to start and stop the RStudio server. When I run RStudio server in a container, I do not, and as I understand it, should not, use systemctl for starting and stopping service. Yet, as Lone_Wolf points out, systemd is installed in the Arch base container and there's a lot of systemd based commands in the container, but presumably none are used or usable, or at least whenever they are used, they will raise the "System has not booted with systemd ...."

Offline

Board footer

Powered by FluxBB