--- /dev/null
+[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
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
+++ /dev/null
-[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