Browse Source

MT#6485 add proper checks for virt-identify

pull/11/head
Victor Seva 12 years ago
parent
commit
eb9dbd87cc
3 changed files with 24 additions and 5 deletions
  1. +9
    -3
      debian/ngcp-rtpengine-daemon.init
  2. +8
    -1
      debian/ngcp-rtpengine-kernel-dkms.postinst
  3. +7
    -1
      debian/ngcp-rtpengine-kernel-dkms.prerm

+ 9
- 3
debian/ngcp-rtpengine-daemon.init View File

@ -67,6 +67,12 @@ if test "$FORK" = "no" ; then
OPTIONS="$OPTIONS --foreground"
fi
if [ -x /usr/sbin/ngcp-virt-identify ]; then
if /usr/sbin/ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
case "$1" in
start)
set +e
@ -84,7 +90,7 @@ case "$1" in
esac
fi
echo -n "Starting $DESC: $NAME"
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
if [ $TABLE -ge 0 ] && [ "$VIRT" != "yes" ]; then
set +e
modprobe xt_MEDIAPROXY
if [ -e /proc/mediaproxy/control ]; then
@ -113,7 +119,7 @@ case "$1" in
if [ "$?" -ne 0 ]; then
return $?
fi
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
if [ $TABLE -ge 0 ] && [ "$VIRT" != "yes" ]; then
set +e
if [ -e /proc/mediaproxy/control ]; then
echo "del $TABLE" > /proc/mediaproxy/control 2>/dev/null
@ -150,7 +156,7 @@ case "$1" in
;;
esac
fi
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
if [ $TABLE -ge 0 ] && [ "$VIRT" != "yes" ]; then
sleep 1
set +e
if [ -e /proc/mediaproxy/control ]; then


+ 8
- 1
debian/ngcp-rtpengine-kernel-dkms.postinst View File

@ -8,7 +8,14 @@ name=ngcp-rtpengine
version=`dpkg-query -W -f='${Version}' "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
if /usr/sbin/ngcp-virt-identify --type container; then
if [ -x /usr/sbin/ngcp-virt-identify ]; then
if /usr/sbin/ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
isadded=`dkms status -m "$name" -v "$version"`


+ 7
- 1
debian/ngcp-rtpengine-kernel-dkms.prerm View File

@ -8,12 +8,18 @@ name=ngcp-rtpengine
version=`dpkg-query -W -f='${Version}' "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
if [ -x /usr/sbin/ngcp-virt-identify ]; then
if /usr/sbin/ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
# make sure it's not running
if [ -x /etc/init.d/ngcp-rtpengine-daemon ] ; then
invoke-rc.d ngcp-rtpengine-daemon stop || true
fi
if /usr/sbin/ngcp-virt-identify --type container; then
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
dkms remove -m "$name" -v "$version" --all || true


Loading…
Cancel
Save