[CinCV TNG] debian/cin.postinst: checks the system settings

Olaf cinmail at womentie.de
Sat Apr 14 13:21:15 CEST 2018


The post-install routine for Debian overrides the settings already made by the system administrator. The proposed function (attachment) is intended to prevent any system settings that have already been made from being overwritten with lower values. Hth

-------------- next part --------------
#!/bin/bash -e
exec > /dev/null 2>&1
if [ ! /proc/self/root -ef /proc/1/root ]; then exit; fi

# This function is intended to prevent any system settings that have
# already been made from being overwritten with lower values.
#
# Debug version, please remove unneeded messages yourself. (The
# above output redirection must be commented out for testing.)
DeBug=t
function SHMTest() {
    CinMax=$(printf "%d\n" $(grep "^kernel.${1}" /etc/sysctl.d/50-cin.conf | cut -f2 -d=))
    [ "${DeBug}" = "t" ] && echo "\"${CinMax}\""
    SysMax=$(cat /proc/sys/kernel/${1})
    [ "${DeBug}" = "t" ] && echo "\"${SysMax}\""
    if [ ${CinMax} -le ${SysMax} ]; then
      [ "${DeBug}" = "t" ] && echo "System setting for ${1} is equal to or greater (${SysMax}) than necessary for Cinelerra (${CinMax})."
    else
        [ "${DeBug}" = "t" ] && echo "Set the system settings for kernel.${1} to ${CinMax}:"
        [ "${DeBug}" != "t" ] && QUIET='-q' || unset QUIET
        sysctl ${QUIET} kernel.${1}=${CinMax}
    fi
}
# kernel.shmmax kernel.shmmni
for j in shmmax shmmni; do 
    SHMTest $j
done
 
#sysctl -p /etc/sysctl.d/50-cin.conf


More information about the Cinelerra mailing list