2018-05-04 11:21:59 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Mender OTA update service
|
|
|
|
After=systemd-resolved.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=idle
|
|
|
|
User=root
|
|
|
|
Group=root
|
2019-02-05 11:49:55 +01:00
|
|
|
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 \
|
2019-03-06 16:49:53 +01:00
|
|
|
echo "No persistent location to store mender data. Data will be lost" \
|
2019-02-05 11:49:55 +01:00
|
|
|
echo "at reboot. Are you sure this is what you want to do?"; \
|
|
|
|
mkdir -p "$(readlink /var/lib/mender)"; \
|
|
|
|
fi; \
|
|
|
|
fi'
|
2018-05-04 11:21:59 +02:00
|
|
|
ExecStart=/usr/bin/mender -daemon
|
|
|
|
Restart=on-abort
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|