Skip to content

Commit

Permalink
Add lool process limits in configuration and configuration example.
Browse files Browse the repository at this point in the history
	modified:   config/lool.sh.example
	modified:   install-lool.sh
  • Loading branch information
RainerEmrich committed Oct 23, 2017
1 parent 1b6980d commit eae23dd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
35 changes: 30 additions & 5 deletions config/lool.sh.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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!
#
Expand Down
10 changes: 10 additions & 0 deletions install-lool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ if [ "${LOOL_INSTALLED}" != "1" ] ; then
sed --in-place "s#>0</max_file_size>#>${LO_DOC_SIZE}</max_file_size>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#></username>#>${LOOL_ADMIN_NAME}</username>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#></password>#>${LOOL_ADMIN_PASSWD}</password>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_virt_mem_kb>#type=\"uint\">${LO_MAX_VIRT_SIZE}</limit_virt_mem_kb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_data_mem_kb>#type=\"uint\">${LO_MAX_DATA_SEG_SIZE}</limit_data_mem_kb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">8000</limit_stack_mem_kb>#type=\"uint\">${LO_MAX_STACK_SIZE}</limit_stack_mem_kb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_file_size_mb>#type=\"uint\">${LO_MAX_FILE_SIZE}</limit_file_size_mb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_num_open_files>#type=\"uint\">${LO_MAX_FILE_NUM}</limit_num_open_files>#" ${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
Expand Down Expand Up @@ -317,6 +322,11 @@ elif [ "${LOOL_VERSION}" != "${LOOL_LAST}" ] ; then
sed --in-place "s#>0</max_file_size>#>${LO_DOC_SIZE}</max_file_size>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#></username>#>${LOOL_ADMIN_NAME}</username>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#></password>#>${LOOL_ADMIN_PASSWD}</password>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_virt_mem_kb>#type=\"uint\">${LO_MAX_VIRT_SIZE}</limit_virt_mem_kb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_data_mem_kb>#type=\"uint\">${LO_MAX_DATA_SEG_SIZE}</limit_data_mem_kb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">8000</limit_stack_mem_kb>#type=\"uint\">${LO_MAX_STACK_SIZE}</limit_stack_mem_kb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_file_size_mb>#type=\"uint\">${LO_MAX_FILE_SIZE}</limit_file_size_mb>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml
sed --in-place "s#type=\"uint\">0</limit_num_open_files>#type=\"uint\">${LO_MAX_FILE_NUM}</limit_num_open_files>#" ${LOOL_PREFIX}/etc/${LOOL_DISTRO}/loolwsd.xml

systemctl start loolwsd
a2ensite ${LOOL_SITE_CONFIG}
Expand Down

0 comments on commit eae23dd

Please sign in to comment.