Buster systemd build intermittently fails

Hello,

I was using a multi-stage, single container application with debian buster using the example files (UDEV=on) and the container would intermittently fail and exit. I did nothing except switch to stretch in my Docker.template file and it has been rock solid for 3 days.

Here is the output. Note, I had this config running on 130 devices, after a few hours, approx 20 or so would start doing this. Reboot solved it, then would intermittently happen again. No such trouble on stretch.

Thanks!

Here’s the output after changing build to stretch:

Hm, this is strange. I’ll let the team that maintains the base images know about this. However this is not the first hurdle we have with systemd in a container. systemd needs the environment to be just right in order to happily run in a container and it can get messy very easily. So as a more general suggestion I would switch systemd off in the containers. This is also the reason our base images currently default to having systemd off.

Yes, unfortunately my solution requires me to run services, such as a monitoring application, inetd and sshd. Do you recommend tini or an alternative?

Tini doesn’t have a notion of services as far as I know. There are few options in Docker’s documentation. If you don’t want something too fancy an adaptation of their bash scripts will do the trick. Otherwise supervisord is a good option: https://docs.docker.com/config/containers/multi-service_container/

Hey @kml001, can you please share with us your Dockerfile template? Have you ever checked our example of installing systemd on Debian Buster here https://github.com/balena-io-library/base-images/tree/master/examples/INITSYSTEM/systemd/systemd.v230?

Hi @nghiant2710,

I am using the examples verbatim. Here’s my files (just switch stretch to buster twice in the Dockerfile.template):
https://gitlab.quokka.one/klewin/rhdev/