Remote systemd journald logging
TL;DR: `echo DESTINATION=http://10.0.254.102 > /cfg/journald-remote` now
activates sending of everything into a remote server.
This was more complex than I expected (ha ha):
- By default, this unit pulls in network-online.target, and that one is
FUBAR on our systemd-networkd setup. That in turn leads to a "failed
unit" check, which transitions the whole system into `degraded`, and
that one leads to a slow and painful watchdog death.
- Even if everything worked, this is a network thingy, and as such it's
rather fragile -- it can die at any time (a broken connection terminates
this service with a failure). That's once again something which leads to
a `degraded` state.
So, let's fix everything by:
- auto-restarts (with a sufficient timeout, etc)
- ignoring network,
- some conditional enablement.
This appears to work, which is awesome if you ask me.
Change-Id: I83ae10d52b35eafd633e77b78b02580c041496b4
diff --git a/package/czechlight-rauc/rauc-hook.sh b/package/czechlight-rauc/rauc-hook.sh
index c701c3e..b6ace5c 100755
--- a/package/czechlight-rauc/rauc-hook.sh
+++ b/package/czechlight-rauc/rauc-hook.sh
@@ -7,10 +7,11 @@
# whitelist so that we don't copy cruft or lost+found
for ITEM in \
etc \
+ journald-remote \
random-seed \
ssh-user-auth \
; do
- if [[ -d /cfg/${ITEM} ]]; then
+ if [[ -d /cfg/${ITEM} || -f /cfg/${ITEM} ]]; then
cp -a /cfg/${ITEM} ${RAUC_SLOT_MOUNT_POINT}/
fi
done