Error disabling systemd

I want to run mender client in standalone mode, but when I follow the instructions to add MENDER_FEATURES_DISABLE_append = " mender-systemd" to local.conf, I get the following build error: ERROR: mender-configure-1.0.0-r0 do_package: SYSTEMD_SERVICE_mender-configure value mender-configure-apply-device-config.service does not exist. I’m using mender v2.6.0 with zeus (5.4) on i.MX6ULL.

Hi Stu,

To be honest I don’t know if it’s ever been tested without the dependency on systemd. I think just doing the SYSTEMD_AUTO_ENABLE = "disable" should be sufficient. If you find that you do need to remove mender-systemd we will happily take a pull request.

Drew

I had tried SYSTEMD_AUTO_ENABLE = "disable" first, but found that the mender daemons were still running. Thinking that maybe bitbake didn’t pick up the change for some reason, I just did a completely clean build but they’re still there. :confused:

That is indeed unexpected. Did you verify that SYSTEMD_AUTO_ENABLE was indeed being set to DISABLE? I wonder if maybe another layer is overriding your setting?

Drew

First, I think the documentation has a bug: meta-mender/meta-mender-core/recipes-mender doesn’t contain a mender directory (nor mender_%.bb), so shouldn’t my layer contain recipes-mender/mender-client/mender-client_%.bbappend instead?

With this change, I did a bitbake -e mender-client and see this:

# $SYSTEMD_AUTO_ENABLE [4 operations]

#   set /yocto-src/sources/poky/meta/conf/documentation.conf:403

#     [doc] "For recipes that inherit the systemd class, this variable specifies whether the service you have specified in SYSTEMD_SERVICE should be started automatically or not."

#   set? /yocto-src/sources/meta-mender/meta-mender-core/recipes-mender/mender-client/mender-client.inc:17

#     "enable"

#   set /yocto-src/sources/poky/meta/classes/systemd.bbclass:9

#     [_defaultval] "enable"

#   set /yocto-dev/layers/meta-orro/recipes-mender/mender-client/mender-client_%.bbappend:1

#     "disable"

# pre-expansion value:

#   "disable"

SYSTEMD_AUTO_ENABLE="disable"

#

but at runtime, you can see that it’s the right build (built a few minutes ago) but mender still daemonized:

root@hermes:~# uname -a
Linux hermes 5.4.24-2.1.0+gbabac008e5cf #1 SMP PREEMPT Thu May 27 15:34:35 UTC 2021 armv7l armv7l armv7l GNU/Linux
root@hermes:~# ps |grep mender
  412 root      873m S    /usr/bin/mender daemon
  413 root      852m S    /usr/bin/mender-connect daemon
 2667 root      2248 S    grep mender

Ok, making some progress here. I did a completely clean build and now the mender-client.service is no longer in /etc/systemd/system/multi-user.target.wants. Mender-client is still launched as a daemon though, because mender-connect.service is still in there and requires mender-client.service. I suspect that if I disable mender-connect.service in a similar .bbappend, I’ll be good.

Confirmed … all good now.

@sjuengst thanks for posting. I’ve run into the same issue. How did you disable the mender connect service?

In my layer, created recipes-mender/mender-connect/mender-connect_%.bbappend with content of

SYSTEMD_AUTO_ENABLE = "disable"

@sjuengst thanks!

@sjuengst hmm, well, I was hoping I could just add those disables and my errors would go away but no such luck. In my local.conf I have MENDER_FEATURES_DISABLE_append = " mender-systemd " and I see this

bitbake -e mender-configure | grep ^SYSTEMD_AUTO_ENABLE
SYSTEMD_AUTO_ENABLE="disable"

But, i still have the top post error

ERROR: mender-configure-1.0.0-r0 do_package: SYSTEMD_SERVICE_mender-configure value mender-configure-apply-device-config.service does not exist

Any thoughts?

fwiw, hard overrides do work, but this seems like it would be unnecessary

SYSTEMD_SERVICE_${PN} = ""
FILES_${PN}_append_mender-systemd = ""