Skip to content

Commit 6106ac9

Browse files
authored
Add more verbose output during package installation (#15)
* Add more verbose output during package installation Add more user facing output during postinst of package installation, requires dropping support for older Ubuntu LTEs with systemd versions pre-232. Do not fail postinst configuration step even if network configuration fails, as we are only interested in package configuration completion.
1 parent 853ead4 commit 6106ac9

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

res/packaging/debian/DEBIAN/postinst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,30 @@ case "$1" in
2525
systemctl daemon-reload > /dev/null 2>&1
2626
fi
2727

28+
status=0
2829
# retrieve the first active network interface
29-
iface=$(ip -oneline address show up | awk '/inet.*brd/{print $2; exit}')
30-
if [ $? -ne 0 ] || [ -z "$iface" ]; then
30+
iface=$(ip -oneline address show up | awk '/inet.*brd/{print $2; exit}') || status=$?
31+
if [ $status -ne 0 ] || [ -z "$iface" ]; then
3132
echo "[x] Could not find an active network interface, manual systemd startup needed"
3233
exit 0
3334
else
3435
echo "[*] Using $iface to bootstrap SCION endhost ..."
3536
fi
3637

3738
if [ ! -f /.dockerenv ]; then
38-
systemctl enable --now scion-bootstrapper@$iface.service > /dev/null 2>&1
39-
systemctl restart --now scion-daemon.service > /dev/null 2>&1
39+
systemctl enable --now scion-bootstrapper@"$iface".service > /dev/null 2>&1 || status=$?
40+
systemctl restart --now scion-daemon.service > /dev/null 2>&1 || true
4041
else
4142
# In a docker environment, run directly
42-
/usr/bin/bootstrapper -iface $iface -config /etc/scion/bootstrapper.toml
43+
/usr/bin/bootstrapper -iface "$iface" -config /etc/scion/bootstrapper.toml || status=$?
44+
fi
45+
if [ $status -ne 0 ]; then
46+
if [ ! -f /.dockerenv ]; then
47+
journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value -p InvocationID [email protected])" | awk 'BEGIN {FS="lvl=eror "} ; /lvl=eror msg=".*/{print "\t"$2;}' || true
48+
fi
49+
echo "[x] Could not bootstrap SCION configuration in the current network, no SCION support available or manual configuration needed."
50+
else
51+
echo "[*] ... and completed SCION endhost configuration successfully. Please start scion-dispatcher where required."
4352
fi
4453
exit 0
4554
;;

0 commit comments

Comments
 (0)