From 95eb2a2b96663147067175604f59447e13633c6e Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 28 Jan 2019 23:00:26 +0100 Subject: [PATCH] TT#51170 Do not fail postinst execution when being executed inside chroot When systemd detects that it's running inside a chroot (like in our installation environment), then it doesn't output something like "active" on stdout, but only string "Running in chroot, ignoring request." on stderr. Since stdout is empty, comparing nothing against string "active" (so `[ = "active"`) will fail test(1) execution. Fixes: | Setting up lua-ngcp-kamailio (6.5.3.1+0~mr6.5.3.1) ... | Running in chroot, ignoring request: is-active | /var/lib/dpkg/info/lua-ngcp-kamailio.postinst: 7: [: =: unexpected operator Change-Id: I11a6b9356b76cd686e0046275a6306431db64105 --- debian/lua-ngcp-kamailio.postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/lua-ngcp-kamailio.postinst b/debian/lua-ngcp-kamailio.postinst index bb6ec24..547159e 100644 --- a/debian/lua-ngcp-kamailio.postinst +++ b/debian/lua-ngcp-kamailio.postinst @@ -4,7 +4,7 @@ set -e case "$1" in configure) - if [ $(systemctl is-active kamailio-proxy) = "active" ] ; then + if [ "$(systemctl is-active kamailio-proxy)" = "active" ] ; then ngcp-sercmd proxy app_lua.reload 0 || true echo "Kamailio proxy module 'app_lua' reloaded" fi