diff --git a/debian/ngcp-rtpengine-daemon.postinst b/debian/ngcp-rtpengine-daemon.postinst index 00d8b51d2..6055b235d 100644 --- a/debian/ngcp-rtpengine-daemon.postinst +++ b/debian/ngcp-rtpengine-daemon.postinst @@ -42,6 +42,19 @@ if [ "$1" = configure ]; then chown rtpengine:rtpengine "$rtpdir" chmod 0770 "$rtpdir" fi + + # set up modprobe.d fragment for auto-load usage + if ! [ -f /etc/modprobe.d/rtpengine.conf ] || grep -q DPKG-GENERATED /etc/modprobe.d/rtpengine.conf; then + OPTIONS="options xt_RTPENGINE proc_mask=0x7" + + PUID=$(id -u rtpengine 2> /dev/null) + test -z "$PUID" || OPTIONS="$OPTIONS proc_uid=$PUID" + PGID=$(id -g rtpengine 2> /dev/null) + test -z "$PGID" || OPTIONS="$OPTIONS proc_gid=$PGID" + + ( echo "# DPKG-GENERATED FILE"; + echo "$OPTIONS" ) > /etc/modprobe.d/rtpengine.conf + fi fi #DEBHELPER# diff --git a/debian/ngcp-rtpengine-daemon.postrm b/debian/ngcp-rtpengine-daemon.postrm index 1826fe80b..7dc97dbd3 100644 --- a/debian/ngcp-rtpengine-daemon.postrm +++ b/debian/ngcp-rtpengine-daemon.postrm @@ -5,6 +5,10 @@ set -e if [ "$1" = purge ]; then deluser --quiet --system rtpengine > /dev/null || true delgroup --quiet --system rtpengine > /dev/null || true + + if [ -f /etc/modprobe.d/rtpengine.conf ] && grep -q DPKG-GENERATED /etc/modprobe.d/rtpengine.conf; then + rm -f /etc/modprobe.d/rtpengine.conf + fi fi #DEBHELPER#