From eae23dda6370e59d947212c23b55025246b38154 Mon Sep 17 00:00:00 2001 From: RainerEmrich Date: Mon, 23 Oct 2017 17:44:35 +0000 Subject: [PATCH] Add lool process limits in configuration and configuration example. modified: config/lool.sh.example modified: install-lool.sh --- config/lool.sh.example | 35 ++++++++++++++++++++++++++++++----- install-lool.sh | 10 ++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/config/lool.sh.example b/config/lool.sh.example index 8691740..9aec6b3 100755 --- a/config/lool.sh.example +++ b/config/lool.sh.example @@ -24,11 +24,6 @@ LOOL_APACHE_SITE_INDEX="101" LOOL_ADMIN_NAME='looladminuser' LOOL_ADMIN_PASSWD='looladminuserpassword' -# -# Define maximum documents size in bytes, defaults to "0" for unlimited. - -LO_DOC_SIZE="0" - # # Define the name of the lool package. LOOL_VERSION="lool-poco-1.7.9-core-cp-5.3-28-online-2.1.4-3" @@ -45,6 +40,36 @@ LOOL_PREFIX="/opt/lool" LOOL_CLIENTS="mysecondcloud.mydomain.tld mythirdcloud.mydomain.tld" +# +# Define maximum documents size in bytes, defaults to "0" for unlimited. + +LO_DOC_SIZE="0" + +# +# Define maximum virtual memory size for each process in Kbytes, defaults to "0" for unlimited, 1700 min.. + +LO_MAX_VIRT_SIZE="100000" + +# +# Define maximum memory data segment size in Kbytes, defaults to "0" for unlimited. + +LO_MAX_DATA_SEG_SIZE="100000" + +# +# Define maximum stack memory size in Kbytes, defaults to "8000", "0" for unlimited. + +LO_MAX_STACK_SIZE="8000" + +# +# Define maximum file size to write in Mbytes, defaults to "0" for unlimited. + +LO_MAX_FILE_SIZE="200" + +# +# Define maximum number of open files, defaults to "0" for unlimited. + +LO_MAX_FILE_NUM="100" + # # Don't edit below! # diff --git a/install-lool.sh b/install-lool.sh index ac6238a..bf7b55f 100755 --- a/install-lool.sh +++ b/install-lool.sh @@ -158,6 +158,11 @@ if [ "${LOOL_INSTALLED}" != "1" ] ; then sed --in-place "s#>0#>${LO_DOC_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml sed --in-place "s#>#>${LOOL_ADMIN_NAME}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml sed --in-place "s#>#>${LOOL_ADMIN_PASSWD}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_VIRT_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_DATA_SEG_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">8000#type=\"uint\">${LO_MAX_STACK_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_FILE_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_FILE_NUM}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml openssl genrsa -out ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/key.pem 4096 chown root:lool ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/key.pem @@ -317,6 +322,11 @@ elif [ "${LOOL_VERSION}" != "${LOOL_LAST}" ] ; then sed --in-place "s#>0#>${LO_DOC_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml sed --in-place "s#>#>${LOOL_ADMIN_NAME}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml sed --in-place "s#>#>${LOOL_ADMIN_PASSWD}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_VIRT_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_DATA_SEG_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">8000#type=\"uint\">${LO_MAX_STACK_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_FILE_SIZE}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml + sed --in-place "s#type=\"uint\">0#type=\"uint\">${LO_MAX_FILE_NUM}#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml systemctl start loolwsd a2ensite ${LOOL_SITE_CONFIG}