Module: sip-router Branch: master Commit: 0d91623616c2459ef8330a7ecb943d7b4f942787 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0d916236...
Author: Iñaki Baz Castillo ibc@aliax.net Committer: Iñaki Baz Castillo ibc@aliax.net Date: Thu Aug 4 10:33:36 2011 +0200
debian: /etc/default/kamailio now includes SHM_MEMORY and PKG_MEMORY variables (rather than just MEMORY). The init script takes those values for -m (shared memory) and -M (private memory) command options. check_kamailio_config() function within the init script also uses "-M $PKG_MEMORY" (so very long configuration files can be parsed by increasing PKG_MEMORY).
---
pkg/kamailio/deb/debian/kamailio.default | 7 +++++-- pkg/kamailio/deb/debian/kamailio.init | 12 +++++++----- pkg/kamailio/deb/lenny/kamailio.default | 13 +++++++++++-- pkg/kamailio/deb/lenny/kamailio.init | 12 +++++++----- pkg/kamailio/deb/lucid/kamailio.default | 13 +++++++++++-- pkg/kamailio/deb/lucid/kamailio.init | 12 +++++++----- pkg/kamailio/deb/squeeze/kamailio.default | 13 +++++++++++-- pkg/kamailio/deb/squeeze/kamailio.init | 12 +++++++----- 8 files changed, 66 insertions(+), 28 deletions(-)
diff --git a/pkg/kamailio/deb/debian/kamailio.default b/pkg/kamailio/deb/debian/kamailio.default index 4d51e42..3221104 100644 --- a/pkg/kamailio/deb/debian/kamailio.default +++ b/pkg/kamailio/deb/debian/kamailio.default @@ -11,8 +11,11 @@ USER=kamailio # Group to run as GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb) -MEMORY=64 +# Amount of shared memory to allocate for the running Kamailio server (in Mb) +SHM_MEMORY=64 + +# Amount of private memory for each Kamailio process (in Mb) +PKG_MEMORY=4
# Switch to USER and GROUP by start-stop-daemon or by kamailio itself # - with recent kernels, changing user ID inside applicaton prevents diff --git a/pkg/kamailio/deb/debian/kamailio.init b/pkg/kamailio/deb/debian/kamailio.init index 0df2b84..4c9a4a5 100644 --- a/pkg/kamailio/deb/debian/kamailio.init +++ b/pkg/kamailio/deb/debian/kamailio.init @@ -39,7 +39,7 @@ check_kamailio_config () { # Check if kamailio configuration is valid before starting the server. set +e - out=$($DAEMON -c 2>&1 > /dev/null) + out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null) retcode=$? set -e if [ "$retcode" != '0' ]; then @@ -114,10 +114,12 @@ fi set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`)) +SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`)) +PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`)) +[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64 +[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4 [ -z "$USER" ] && USER=kamailio [ -z "$GROUP" ] && GROUP=kamailio -[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then @@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP" SSDOPTS="" else - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY" SSDOPTS="--chuid $USER:$GROUP" fi
diff --git a/pkg/kamailio/deb/lenny/kamailio.default b/pkg/kamailio/deb/lenny/kamailio.default index 4317664..3221104 100644 --- a/pkg/kamailio/deb/lenny/kamailio.default +++ b/pkg/kamailio/deb/lenny/kamailio.default @@ -11,8 +11,17 @@ USER=kamailio # Group to run as GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb) -MEMORY=64 +# Amount of shared memory to allocate for the running Kamailio server (in Mb) +SHM_MEMORY=64 + +# Amount of private memory for each Kamailio process (in Mb) +PKG_MEMORY=4 + +# Switch to USER and GROUP by start-stop-daemon or by kamailio itself +# - with recent kernels, changing user ID inside applicaton prevents +# dumping core files. If the value is 'yes', the suid is done by +# start-stop-daemon, otherwise it is done by kamailio itself +SSD_SUID=no
# Enable the server to leave a core file when it crashes. # Set this to 'yes' to enable Kamailio to leave a core file when it crashes diff --git a/pkg/kamailio/deb/lenny/kamailio.init b/pkg/kamailio/deb/lenny/kamailio.init index 0df2b84..4c9a4a5 100644 --- a/pkg/kamailio/deb/lenny/kamailio.init +++ b/pkg/kamailio/deb/lenny/kamailio.init @@ -39,7 +39,7 @@ check_kamailio_config () { # Check if kamailio configuration is valid before starting the server. set +e - out=$($DAEMON -c 2>&1 > /dev/null) + out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null) retcode=$? set -e if [ "$retcode" != '0' ]; then @@ -114,10 +114,12 @@ fi set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`)) +SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`)) +PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`)) +[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64 +[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4 [ -z "$USER" ] && USER=kamailio [ -z "$GROUP" ] && GROUP=kamailio -[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then @@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP" SSDOPTS="" else - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY" SSDOPTS="--chuid $USER:$GROUP" fi
diff --git a/pkg/kamailio/deb/lucid/kamailio.default b/pkg/kamailio/deb/lucid/kamailio.default index 4317664..3221104 100644 --- a/pkg/kamailio/deb/lucid/kamailio.default +++ b/pkg/kamailio/deb/lucid/kamailio.default @@ -11,8 +11,17 @@ USER=kamailio # Group to run as GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb) -MEMORY=64 +# Amount of shared memory to allocate for the running Kamailio server (in Mb) +SHM_MEMORY=64 + +# Amount of private memory for each Kamailio process (in Mb) +PKG_MEMORY=4 + +# Switch to USER and GROUP by start-stop-daemon or by kamailio itself +# - with recent kernels, changing user ID inside applicaton prevents +# dumping core files. If the value is 'yes', the suid is done by +# start-stop-daemon, otherwise it is done by kamailio itself +SSD_SUID=no
# Enable the server to leave a core file when it crashes. # Set this to 'yes' to enable Kamailio to leave a core file when it crashes diff --git a/pkg/kamailio/deb/lucid/kamailio.init b/pkg/kamailio/deb/lucid/kamailio.init index 0df2b84..4c9a4a5 100644 --- a/pkg/kamailio/deb/lucid/kamailio.init +++ b/pkg/kamailio/deb/lucid/kamailio.init @@ -39,7 +39,7 @@ check_kamailio_config () { # Check if kamailio configuration is valid before starting the server. set +e - out=$($DAEMON -c 2>&1 > /dev/null) + out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null) retcode=$? set -e if [ "$retcode" != '0' ]; then @@ -114,10 +114,12 @@ fi set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`)) +SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`)) +PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`)) +[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64 +[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4 [ -z "$USER" ] && USER=kamailio [ -z "$GROUP" ] && GROUP=kamailio -[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then @@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP" SSDOPTS="" else - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY" SSDOPTS="--chuid $USER:$GROUP" fi
diff --git a/pkg/kamailio/deb/squeeze/kamailio.default b/pkg/kamailio/deb/squeeze/kamailio.default index 4317664..3221104 100644 --- a/pkg/kamailio/deb/squeeze/kamailio.default +++ b/pkg/kamailio/deb/squeeze/kamailio.default @@ -11,8 +11,17 @@ USER=kamailio # Group to run as GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb) -MEMORY=64 +# Amount of shared memory to allocate for the running Kamailio server (in Mb) +SHM_MEMORY=64 + +# Amount of private memory for each Kamailio process (in Mb) +PKG_MEMORY=4 + +# Switch to USER and GROUP by start-stop-daemon or by kamailio itself +# - with recent kernels, changing user ID inside applicaton prevents +# dumping core files. If the value is 'yes', the suid is done by +# start-stop-daemon, otherwise it is done by kamailio itself +SSD_SUID=no
# Enable the server to leave a core file when it crashes. # Set this to 'yes' to enable Kamailio to leave a core file when it crashes diff --git a/pkg/kamailio/deb/squeeze/kamailio.init b/pkg/kamailio/deb/squeeze/kamailio.init index 0df2b84..4c9a4a5 100644 --- a/pkg/kamailio/deb/squeeze/kamailio.init +++ b/pkg/kamailio/deb/squeeze/kamailio.init @@ -39,7 +39,7 @@ check_kamailio_config () { # Check if kamailio configuration is valid before starting the server. set +e - out=$($DAEMON -c 2>&1 > /dev/null) + out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null) retcode=$? set -e if [ "$retcode" != '0' ]; then @@ -114,10 +114,12 @@ fi set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`)) +SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`)) +PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`)) +[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64 +[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4 [ -z "$USER" ] && USER=kamailio [ -z "$GROUP" ] && GROUP=kamailio -[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then @@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP" SSDOPTS="" else - OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY" + OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY" SSDOPTS="--chuid $USER:$GROUP" fi