How to install 'systemctl' on Ubuntu (docker)?

Joe picture Joe · Mar 27, 2018 · Viewed 9.2k times · Source

I have a docker with Ubuntu 16.04 and trying to install mysql-server in it. Installation went fine (apt-get install -y mysql-server) and now is time to run a server:

systemctl status mysql
Failed to connect to bus: No such file or directory

How to find/install systemctl for Ubuntu 16.04 (docker) and are there alternatives?

Answer

ThilinaB picture ThilinaB · Jul 5, 2018

Systemd is not installed on the ubuntu docker image. You can use the "service" command

service mysql start
service mysql status

You can also use the mysql docker image instead of installing mysql manually on ubuntu.