# Balena Engine on platforms without systemd

**URL:** <https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731>\
**Category:** balenaEngine\
**Tags:** systemd\
**Created:** [July 9, 2021, 2:41pm UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731 "2021-07-09T14:41:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qbicz](https://avatars.discourse-cdn.com/v4/letter/q/90db22/32.png) [@Qbicz](https://forums.balena.io/u/Qbicz)\
**Post date:** [July 9, 2021, 2:41pm UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/1 "2021-07-09T14:41:22Z")

</div>

Hi!

We’re preparing to use Balena engine, however on our Linux platform we use sysVinit as an init system, and systemd is disabled.

> ./balena-engine  
> ./balena-engine: error while loading shared libraries: libsystemd.so.0: cannot open shared object file: No such file or directory

Is it possible to configure Balena Engine to run with sysVinit? I found this:

> <https://github.com/balena-os/balena-engine/tree/master/contrib/init>
>
> //github.com/balena-os/balena-engine/tree/master/contrib/init

and this: [Debian package - remove SysVinit configuration because it's not used · Issue #30936 · moby/moby · GitHub](https://github.com/moby/moby/issues/30936)

This topic also mentions that it is possible: [no systemd · Issue #87 · balena-os/balena-engine · GitHub](https://github.com/balena-os/balena-engine/issues/87)

What are the steps to run the balena engine on a Linux device that has sysVinit as init system?

Thanks,  
Filip

---

<div class="post-metadata">

**Author:** ![tmigone](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tmigone/32/2814_2.png) [@tmigone](https://forums.balena.io/u/tmigone)\
**Post date:** [July 9, 2021, 3:07pm UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/3 "2021-07-09T15:07:12Z")

</div>

Hi there, it might be that it is now a requirement. I’ll check with the engine team and let you know.

---

<div class="post-metadata">

**Author:** ![Qbicz](https://avatars.discourse-cdn.com/v4/letter/q/90db22/32.png) [@Qbicz](https://forums.balena.io/u/Qbicz)\
**Post date:** [July 15, 2021, 7:08am UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/5 "2021-07-15T07:08:35Z")

</div>

Hi @tmigone! Do you know already of this is a hard requirement to have systemd? I sincerely hope it isn’t… 😉

---

<div class="post-metadata">

**Author:** ![klutchell](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/klutchell/32/861_2.png) [@klutchell](https://forums.balena.io/u/klutchell)\
**Post date:** [July 15, 2021, 10:12pm UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/6 "2021-07-15T22:12:11Z")

</div>

Hey, can you let us know where you are downloading the version of balena-engine you tried, or are you building it from source? You could try it with a build flag like `no_journald` to remove the systemd dependency.

---

<div class="post-metadata">

**Author:** ![Qbicz](https://avatars.discourse-cdn.com/v4/letter/q/90db22/32.png) [@Qbicz](https://forums.balena.io/u/Qbicz)\
**Post date:** [July 16, 2021, 8:28am UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/8 "2021-07-16T08:28:32Z")

</div>

So far we have tried the latest binary for armv6.

I have just tried compiling the balena-engine, but I didn’t find any documentation on building from source. Please tell me if what I did is correct:

Changed the flag from journald to no\_journald in [make.sh](https://github.com/balena-os/balena-engine/blob/master/hack/make.sh#L96):

```auto
filip@prec:~/downloads/balena-engine$ git diff
diff --git a/hack/make.sh b/hack/make.sh
index ecd1288831..d91cd808af 100755
--- a/hack/make.sh
+++ b/hack/make.sh
@@ -93,9 +93,9 @@ add_buildtag() {
 }
 
 if ${PKG_CONFIG} 'libsystemd >= 209' 2> /dev/null ; then
- DOCKER_BUILDTAGS+=" journald"
+ DOCKER_BUILDTAGS+=" no_journald"
 elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null ; then
- DOCKER_BUILDTAGS+=" journald journald_compat"
+ DOCKER_BUILDTAGS+=" no_journald"
 fi

```

Then I have run make. Looks like it has created a container and run the build inside, and produced the binary of the daemon:

```auto
filip@prec:~/downloads/balena-engine$ ls -l bundles/binary-daemon/
total 44588
lrwxrwxrwx 1 root root 17 lip 16 09:59 balena-engine -> balena-engine-dev
-rwxr-xr-x 1 root root 45644336 lip 16 09:59 balena-engine-dev
-rw-r--r-- 1 root root 52 lip 16 09:59 balena-engine-dev.md5
-rw-r--r-- 1 root root 84 lip 16 09:59 balena-engine-dev.sha256

```

Is this correct?  
Another question: I want to build it for armv6 only. How to achieve that?

---

<div class="post-metadata">

**Author:** ![Qbicz](https://avatars.discourse-cdn.com/v4/letter/q/90db22/32.png) [@Qbicz](https://forums.balena.io/u/Qbicz)\
**Post date:** [July 16, 2021, 8:46am UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/9 "2021-07-16T08:46:56Z")

</div>

Ok, by grepping the repo I found this guide: [balena-engine/PACKAGERS.md at master · balena-os/balena-engine · GitHub](https://github.com/balena-os/balena-engine/blob/master/project/PACKAGERS.md)

So I compiled with

```auto
make DOCKER_CROSSPLATFORMS=linux/arm/v7 cross

```

And I got a binary for armv6

```auto
$ file bundles/cross/linux/arm/v6/balena-engine-dev
bundles/cross/linux/arm/v6/balena-engine-dev: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=23RRcf-7UnZBmEzbO5AH/_L4heeztWQRG3wI96n6k/Nt0bh7RxNHNDwKmLUfJ-/I4W21j2Mn7vv9ro88MI5, stripped

```

Hopefully will work on armv6 without systemd.

---

<div class="post-metadata">

**Author:** ![Qbicz](https://avatars.discourse-cdn.com/v4/letter/q/90db22/32.png) [@Qbicz](https://forums.balena.io/u/Qbicz)\
**Post date:** [July 21, 2021, 10:36am UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/12 "2021-07-21T10:36:01Z")

</div>

Hi @klutchell @tmigone. Do you maybe have a list of dependencies that Balena expects from the underlying Linux system?

On our system, it looks like a few dependencies are missing:

```auto
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: Iptables not found

```

```auto
ERRO[2021-07-21T09:44:03.911698086Z] Failed to built-in GetDriver graph btrfs /var/lib/balena-engine
ERRO[2021-07-21T09:44:03.914922995Z] Failed to built-in GetDriver graph zfs /var/lib/balena-engine
ERRO[2021-07-21T09:44:04.170617814Z] AUFS was not found in /proc/filesystems storage-driver=aufs
ERRO[2021-07-21T09:44:04.279133766Z] Failed to built-in GetDriver graph devicemapper /var/lib/balena-engine
WARN[2021-07-21T09:44:04.459445702Z] Your kernel does not support swap memory limit
WARN[2021-07-21T09:44:04.465744526Z] Your kernel does not support cgroup rt period
WARN[2021-07-21T09:44:04.468153458Z] Your kernel does not support cgroup rt runtime
WARN[2021-07-21T09:44:04.470562390Z] Your kernel does not support cgroup blkio weight
WARN[2021-07-21T09:44:04.475898240Z] Your kernel does not support cgroup blkio weight_device
WARN[2021-07-21T09:44:04.480019125Z] Your kernel does not support cgroup blkio throttle.read_bps_device
WARN[2021-07-21T09:44:04.481125094Z] Your kernel does not support cgroup blkio throttle.write_bps_device
WARN[2021-07-21T09:44:04.481408086Z] Your kernel does not support cgroup blkio throttle.read_iops_device
WARN[2021-07-21T09:44:04.481615080Z] Your kernel does not support cgroup blkio throttle.write_iops_device
WARN[2021-07-21T09:44:04.486189951Z] Unable to find cpuset cgroup in mounts

```

---

<div class="post-metadata">

**Author:** ![klutchell](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/klutchell/32/861_2.png) [@klutchell](https://forums.balena.io/u/klutchell)\
**Post date:** [July 21, 2021, 1:09pm UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/13 "2021-07-21T13:09:38Z")

</div>

Remember that our balenaEngine is just a fork of the Docker/moby project so the same dependencies would apply. In this case you could either install iptables or enable legacy iptables as per this forum post:

> **[Failing to start dockerd: failed to create NAT chain DOCKER](https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269/2)**
>
> The docker installer uses iptables for nat. Unfortunately Debian uses nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables. sudo update-alternatives --set iptables /usr/sbin/iptables-legacy sudo...

If any other dependencies are missing I would personally just search for answers on the Docker forums or the moby project GH as it’s more likely to have been answered there!

---

<div class="post-metadata">

**Author:** ![Qbicz](https://avatars.discourse-cdn.com/v4/letter/q/90db22/32.png) [@Qbicz](https://forums.balena.io/u/Qbicz)\
**Post date:** [July 23, 2021, 6:48am UTC](https://forums.balena.io/t/balena-engine-on-platforms-without-systemd/337731/15 "2021-07-23T06:48:31Z")

</div>

Good news is that balena-engine is already included in buildroot and most (not all) of the dependencies are taken care of: [buildroot/package/balena-engine at master · buildroot/buildroot · GitHub](https://github.com/buildroot/buildroot/tree/master/package/balena-engine)  
Kudos to Tian Yuanhao.

It also cross-compiles to a correct architecture automatically, based on the information that buildroot already has.

For future, here is the list of runtime dependencies of Balena Engine / Docker:

> <https://github.com/balena-os/balena-engine/blob/master/project/PACKAGERS.md#runtime-dependencies>
