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
changes/37/26737/1
Michael Prokop 7 years ago
parent e852f52279
commit 95eb2a2b96

@ -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

Loading…
Cancel
Save