From d4e4010b5d4c28b367c23bf98d28b017bf485cc6 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 24 Jun 2014 06:23:03 +0200 Subject: [PATCH] MT#6485 Container detection in init script. Minor improve. Just run onces the command to detect virt environment. --- debian/ngcp-sems.init | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/ngcp-sems.init b/debian/ngcp-sems.init index a5b6ed07..60aeecee 100644 --- a/debian/ngcp-sems.init +++ b/debian/ngcp-sems.init @@ -62,8 +62,14 @@ if test "$SEMS_CFG_FILE" ; then CFGPARAMS="-f $SEMS_CFG_FILE" fi -if test "$SEMS_CREATE_CORE" = "yes" ; then +if [ -x /usr/sbin/ngcp-virt-identify ]; then if /usr/sbin/ngcp-virt-identify --type container; then + VIRT="yes" + fi +fi + +if test "$SEMS_CREATE_CORE" = "yes" ; then + if [ "$VIRT" = "yes" ]; then echo "Container environment detected. Skipping core dump configuration." else # directory for the core dump files @@ -75,7 +81,7 @@ if test "$SEMS_CREATE_CORE" = "yes" ; then fi fi -if /usr/sbin/ngcp-virt-identify --type container; then +if [ "$VIRT" = "yes" ]; then echo "Container environment detected. Skipping file descriptors limit configuration." else # raise file descriptors limit - call hold consumes two fds for RTP ports and one for moh file