System has not been booted with systemd as init system (PID 1). Can't operate.

I have a installation script from a service called Vodia, but we can’t seem to get the script to run due to the following error:

System has not been booted with systemd as init system (PID 1). Can't operate.
FROM ubuntu

ARG DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN apt-get install wget systemd -y

RUN wget http://portal.vodia.com/downloads/pbx/install-debian.sh

RUN chmod a+rx install-debian.sh

# RUN ./install-debian.sh
CMD ["/bin/sh", "install-debian.sh"]
# CMD ["ps", "-C", "pbxctrl"]

Would anyone have any ideas how to get ubuntu to use systemd as its out of our control that it uses systemd. We have tested this on a normal ubuntu box without docker and everything works fine.

As you can see from the Dockerfile, we have tried to run the install script both during the build step and when deploying on the actual VM with no luck.

Thanks

We run our own init as PID 1. It can’t be replaced by anything else as it’s responsible for doing some initialization during machine boot and providing API for things like fly machine exec.

What you can try is to install Vodia on a normal Ubuntu machine and copy the resulting files into a Docker image. You will need to set CMD to launch Vodia directly and not via a systemd service.

But, if their tooling depends on systemctl, I don’t think it’s possible to use it on Fly.

1 Like

Hi @danwetherald,

@pavel is correct that we run our own init as PID 1 which prevents systemd from running normally. However, we have had some internal success starting systemd in its own namespace using unshare:

CMD ["unshare", "--pid", "--fork", "--mount-proc", "/lib/systemd/systemd"]

Then you can use nsenter to enter the namespace to run systemctl commands.

There might be some rough edges, but hopefully this gives you a starting point for some further experimentation if you’re interested. Let me know if this works for you!

1 Like

We were able to modify the start up script to not use systemd - thanks for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.