From: Adam Duskett Date: Fri, 28 Aug 2020 17:08:44 +0000 (-0700) Subject: package/mender: Fix incorrectly named service file X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db751e2c89be128c858d466d5cc689aa16704f6c;p=buildroot.git package/mender: Fix incorrectly named service file Many of the mender CLI commands use systemctl commands to get information about the daemon, such as the PID (IE: systemctl show -p MainPID mender-client). As seen above, these commands expect the service file to be named "mender-client" instead of "mender." As such, in the current state, running a forced update check in the CLI will result in the following error: failed to force updateCheck: could not find the PID of the mender daemon. Changing the name of mender.service to mender-client.service fixes the issue. Signed-off-by: Adam Duskett Signed-off-by: Peter Korsgaard --- diff --git a/package/mender/mender-client.service b/package/mender/mender-client.service new file mode 100644 index 0000000000..2a5f476ee5 --- /dev/null +++ b/package/mender/mender-client.service @@ -0,0 +1,24 @@ +[Unit] +Description=Mender OTA update service +After=systemd-resolved.service + +[Service] +Type=idle +User=root +Group=root +ExecStartPre=/bin/sh -c '\ +if [ -L /var/lib/mender \ + -a "$(readlink /var/lib/mender)" = "/var/run/mender" ]; then \ + if rm -f /var/lib/mender >/dev/null 2>&1; then \ + mkdir -p /var/lib/mender; \ + else \ + echo "No persistent location to store mender data. Data will be lost" \ + echo "at reboot. Are you sure this is what you want to do?"; \ + mkdir -p "$(readlink /var/lib/mender)"; \ + fi; \ +fi' +ExecStart=/usr/bin/mender -daemon +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/package/mender/mender.mk b/package/mender/mender.mk index 325141787e..ca24b853b5 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -77,8 +77,8 @@ endef MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES define MENDER_INSTALL_INIT_SYSTEMD - $(INSTALL) -D -m 0644 $(MENDER_PKGDIR)/mender.service \ - $(TARGET_DIR)/usr/lib/systemd/system/mender.service + $(INSTALL) -D -m 0644 $(MENDER_PKGDIR)/mender-client.service \ + $(TARGET_DIR)/usr/lib/systemd/system/mender-client.service endef define MENDER_INSTALL_INIT_SYSV diff --git a/package/mender/mender.service b/package/mender/mender.service deleted file mode 100644 index 2a5f476ee5..0000000000 --- a/package/mender/mender.service +++ /dev/null @@ -1,24 +0,0 @@ -[Unit] -Description=Mender OTA update service -After=systemd-resolved.service - -[Service] -Type=idle -User=root -Group=root -ExecStartPre=/bin/sh -c '\ -if [ -L /var/lib/mender \ - -a "$(readlink /var/lib/mender)" = "/var/run/mender" ]; then \ - if rm -f /var/lib/mender >/dev/null 2>&1; then \ - mkdir -p /var/lib/mender; \ - else \ - echo "No persistent location to store mender data. Data will be lost" \ - echo "at reboot. Are you sure this is what you want to do?"; \ - mkdir -p "$(readlink /var/lib/mender)"; \ - fi; \ -fi' -ExecStart=/usr/bin/mender -daemon -Restart=on-abort - -[Install] -WantedBy=multi-user.target