kumquat-buildroot/package/mender/mender.service
Angelo Compagnucci e78d516178 package/mender: adding a writable location
Mender needs /var/lib/mender to be writable at the service start, the
path is hardcoded and thus we cannot change it.
This patch solves the problem using the same approach we have for
dropbear.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: <aduskett@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-02-05 13:40:10 +01:00

25 lines
641 B
Desktop File

[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