2

I am running Bosh lite on my machine where I deployed a Patroni cluster on three garden container running on Ubuntu 16.04 Stemcell. I created a systemd service and I would like to use it in this test environment, but I cannot start it.

The problem is that Bosh lite by default doesn't start with systemd and if I run:

systemctl --user start patroni_fencer.service

I got the following error:

Failed to connect to bus: No such file or directory

I found two possible discussions on StackOverflow:

Failed to connect to bus: No such file or directory

systemd servicefailed to connect to session d-bus

but they do not solve my issue because they refer to Docker and my problem is on Bosh lite. I noticed Bosh lite has garden-init as PID 1 process and it starts with runit system.

Is there a way to test my systemd service in my Bosh lite containers? It would be ok also if I can start systemd manually and then run the typical systemctl command. This is only a test environment.

Rowan Jacobs
  • 389
  • 4
  • 13
Salvatore D'angelo
  • 1,019
  • 3
  • 14
  • 39

1 Answers1

1

The docker-systemctl-replacement does not need a running systemd daemon to start services defined in some *.service file. If you do not use it inside of docker then you can just run the systemctl.py script without installing it.

What the tool does: it looks for a patroni_fencer.service in the standard directories. It will look for the ExecStart line, interpret and exec it. The exec'ed command is detached from systemctl.py so that it will be reparented to the PID-1 whichever that is on your system.

Guido U. Draheim
  • 3,038
  • 1
  • 20
  • 19