From 85e77cc27aef53fd1524fc39627d6b39168b4f09 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 28 Feb 2019 09:22:50 +0100 Subject: [PATCH] TT#53525 postinst: use service(8) to identify active kamailio-proxy instance systemctl(1) (provided by systemd) isn't necessarily available in the environment yet, e.g. as identified by piuparts tests. Instead of relying on systemctl(1) let's use service(8) from init-system-helpers (which is an essential package), and while at it report the exit code of the app_lua reload. Fixes: | /var/lib/dpkg/info/lua-ngcp-kamailio.postinst: 7: /var/lib/dpkg/info/lua-ngcp-kamailio.postinst: systemctl: not found Change-Id: I52cf30d6421f58c77ce1983d95c141d3a331e939 --- debian/lua-ngcp-kamailio.postinst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/lua-ngcp-kamailio.postinst b/debian/lua-ngcp-kamailio.postinst index 547159e..244ad49 100644 --- a/debian/lua-ngcp-kamailio.postinst +++ b/debian/lua-ngcp-kamailio.postinst @@ -4,9 +4,10 @@ set -e case "$1" in configure) - if [ "$(systemctl is-active kamailio-proxy)" = "active" ] ; then - ngcp-sercmd proxy app_lua.reload 0 || true - echo "Kamailio proxy module 'app_lua' reloaded" + if service kamailio-proxy status >/dev/null 2>&1 ; then + echo "kamailio-proxy seems to be active, reloading app_lua" + ngcp-sercmd proxy app_lua.reload 0 || RC=$? + echo "Kamailio proxy module 'app_lua' reloaded (exit code: ${RC:-0})" fi ;;