# Didn't find service unit 'mender-client.service'

**URL:** <https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740>\
**Category:** General Discussions\
**Tags:** mender-client, dunfell, kirkstone\
**Created:** [April 6, 2023, 10:35am UTC](https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740 "2023-04-06T10:35:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![janaperic](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/janaperic/32/1608_2.png) [@janaperic](https://hub.mender.io/u/janaperic)\
**Post date:** [April 6, 2023, 10:35am UTC](https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740/1 "2023-04-06T10:35:14Z")

</div>

Hi! I need help. 🙂

I’ve been working on upgrading my Yocto image for RPi4 from dunfell to kirkstone, and I’ve encountered some problems regarding mender-client.  
When I try to build the image, I get this error:

`mender-client-3.5.0-r0 do_package: Didn't find service unit 'mender-client.service', specified in SYSTEMD_SERVICE:mender-client.`

I’ve tried using versions of mender-client from 3.3.0 to 3.5.0, and I’ve tried kikrstone and master branches of meta-mender, but the same thing happens each time.

I’ve investigated kirkstone branch of meta-mender a bit, and I’ve noticed that in mender-client recipe, the mender-client.service is, indeed, missing. There are some other recipes like _mender-client-data-dir.service_, or _mender-client-systemd-machine-id.service_, but no mender-client.service.

In mender-client.inc file I can see that mender-client.service is used multiple times, but it can’t be installed because it seems to be missing from _files_ directory in the recipe.

Can you help me with this? What am I missing?

Best regards,  
Jana Peric

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [April 6, 2023, 10:54am UTC](https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740/2 "2023-04-06T10:54:33Z")

</div>

Hi @janaperic,

The `kirkstone` build is regularly tested, so I’m a bit surprised. Is it a fresh build set up, or did you bump the layer versions up? If so, which layers are involved at which hashes so I can cross-check that.

Any other specialities that might be relevant?

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![janaperic](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/janaperic/32/1608_2.png) [@janaperic](https://hub.mender.io/u/janaperic)\
**Post date:** [April 6, 2023, 11:17am UTC](https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740/3 "2023-04-06T11:17:43Z")

</div>

Hi!  
it’s a fresh build for kirkstone. I’ve just started working on it, and after dealing with syntax errors, mender-client is the first issue I’ve come across. The reason why we are upgrading to kirkstone is because of TPM, we need tpm2-openssl and some other TPM packages which are better integrated on kirkstone compared to dunfell.

These are the layers we use with hashes (all repos are on kirkstone branch):

```auto
meta-mender: dd226ab714fe309503d7690c0ea60a9842028bdd
meta-openembedded: 9cf4ebeb3de524009a73f49722489dc4aa183adb
meta-raspberry-pi: dacad9302a92b0b7edf8546cdcad1f8ef753e462
meta-security: cc20e2af2ae1c74e306f6c039c4963457c4cbd0f
poky: 407c3e0237d947ec003bdd1af89a226121c7939c

```

Besides these layers, we also have 2 of our own layers, but they don’t add any functionalities to mender (besides one state script which worked fine on dunfell).

I think it’s important to note that we haven’t made any changes in configuration of our layers when we switched to kirkstone, besides the mandatory syntax changes and LAYERSERIES\_COMPAT flag.

Another error that I got previously was this:  
`build/tmp/work/cortexa72-poky-linux/mender-client/3.5.0-r0/image/var/lib/mender/' is not a directory: No such file or directory`  
But I’ve managed to solve that one by adding this code to mender-client\_%.bbappend:

```auto
do_install() {
    install -d ${D}/var/lib/mender
    install -d ${D}${systemd_unitdir}/system/
    install -d ${D}${sysconfdir}/mender
}

FILES_${PN} += "\
    /var/lib/mender \
    ${systemd_unitdir}/system/ \
    ${sysconfdir}/mender \
"

```

Thanks for looking into this!  
Best regards,  
Jana

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [April 6, 2023, 3:21pm UTC](https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740/4 "2023-04-06T15:21:44Z")

</div>

Hi @janaperic,

gave it a spin with the layers and revisions that you defined, build manifest is

```auto
Build Configuration:
BB_VERSION = "2.0.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-22.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi4"
DISTRO = "poky"
DISTRO_VERSION = "4.0.8"
TUNE_FEATURES = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU = "hard"
meta
meta-poky
meta-yocto-bsp = "kirkstone:407c3e0237d947ec003bdd1af89a226121c7939c"
meta-oe = "HEAD:9cf4ebeb3de524009a73f49722489dc4aa183adb"
meta-mender-core = "kirkstone:dd226ab714fe309503d7690c0ea60a9842028bdd"
meta-raspberrypi = "kirkstone:dacad9302a92b0b7edf8546cdcad1f8ef753e462"
meta-mender-raspberrypi = "kirkstone:dd226ab714fe309503d7690c0ea60a9842028bdd"
meta-python
meta-perl
meta-networking = "HEAD:9cf4ebeb3de524009a73f49722489dc4aa183adb"
meta-security = "kirkstone:cc20e2af2ae1c74e306f6c039c4963457c4cbd0f"

```

and it build with only a patch warning on `u-boot`. So at least at the moment I have to guess that either something in your `TMPDIR` or additional metadata causes the problem. Can you try to remove `tmp` and build again? If this does not solve the problem, I’d suggest to start from the generic build without your custom layers/distro, and then proceed from there.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![janaperic](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/janaperic/32/1608_2.png) [@janaperic](https://hub.mender.io/u/janaperic)\
**Post date:** [April 10, 2023, 9:55am UTC](https://hub.mender.io/t/didnt-find-service-unit-mender-client-service/5740/5 "2023-04-10T09:55:01Z")

</div>

Thank you! It worked. 🙂 Sorry for the trouble.

Best regards,  
Jana
