From 218efa5b35b2dca9f935bf68ccad756e7c3e469d Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 25 Oct 2022 17:40:37 -0300 Subject: [PATCH] Restart multi-sn lokinet-routers.target on upgrade --- debian/lokinet-bin.postinst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/lokinet-bin.postinst b/debian/lokinet-bin.postinst index 1b2ed4f2c..dbfd0fa6c 100644 --- a/debian/lokinet-bin.postinst +++ b/debian/lokinet-bin.postinst @@ -32,3 +32,13 @@ if [ "$1" = configure ]; then fi #DEBHELPER# + +# Also restart the lokinet-routers.target (from oxen-multi-sn) on upgrade if it is active +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + if [ -n "$2" ] && [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + if systemctl --quiet is-active lokinet-routers.target; then + deb-systemd-invoke restart lokinet-routers.target >/dev/null || true + fi + fi +fi