summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2020-04-09 09:02:58 -0400
committerAshod Nakashian <ashnakash@gmail.com>2020-07-01 05:42:43 +0200
commit5c9988f2e345ca82e7bb5f5e9bf66a30b82a0446 (patch)
tree800833d3e10231fa92d1afbcfeb01cff4751ae47 /Makefile.am
parent582139eb998432539d79427f22de0eadb25b5ab7 (diff)
wsd: faster jail setup via bind-mount
loolmount now works and supports mounting and unmounting, plus numerous improvements, refactoring, logging, etc.. When enabled, binding improves the jail setup time by anywhere from 2x to orders of magnitude (in docker, f.e.). A new config entry mount_jail_tree controls whether mounting is used or the old method of linking/copying of jail contents. It is set to true by default and falls back to linking/copying. A test mount is done when the setting is enabled, and if mounting fails, it's disabled to avoid noise. Temporarily disabled for unit-tests until we can cleanup lingering mounts after Jenkins aborts our build job. In a future patch we will have mount/jail cleanup as part of make. The network/system files in /etc that need frequent refreshing are now updated in systemplate to make their most recent version available in the jails. These files can change during the course of loolwsd lifetime, and are unlikely to be updated in systemplate after installation at all. We link to them in the systemplate/etc directory, and if that fails, we copy them before forking each kit instance to have the latest. This reworks the approach used to bind-mount the jails and the templates such that the total is now down to only three mounts: systemplate, lo, tmp. As now systemplate and lotemplate are shared, they must be mounted as readonly, this means that user/ must now be moved into tmp/user/ which is writable. The mount-points must be recursive, because we mount lo/ within the mount-point of systemplate (which is the root of the jail). But because we (re)bind recursively, and because both systemplate and lotemplate are mounted for each jails, we need to make them unbindable, so they wouldn't multiply the mount-points for each jails (an explosive growth!) Contrarywise, we don't want the mount-points to be shared, because we don't expect to add/remove mounts after a jail is created. The random temp directory is now created and set correctly, plus many logging and other improvements. Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 171a07e36..d3f18e6a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,7 @@ export ENABLE_DEBUG
bin_PROGRAMS = \
loolforkit \
+ loolmount \
loolconvert loolconfig
if ENABLE_LIBFUZZER
@@ -87,6 +88,7 @@ AM_ETAGSFLAGS = --c++-kinds=+p --fields=+iaS --extra=+q -R --totals=yes --exclud
AM_CTAGSFLAGS = $(AM_ETAGSFLAGS)
shared_sources = common/FileUtil.cpp \
+ common/JailUtil.cpp \
common/Log.cpp \
common/Protocol.cpp \
common/StringVector.cpp \
@@ -131,7 +133,6 @@ noinst_PROGRAMS = clientnb \
lokitclient \
loolmap \
loolstress \
- loolmount \
loolsocketdump
if ENABLE_LIBFUZZER
@@ -239,6 +240,7 @@ shared_headers = common/Common.hpp \
common/Crypto.hpp \
common/JsonUtil.hpp \
common/FileUtil.hpp \
+ common/JailUtil.hpp \
common/Log.hpp \
common/LOOLWebSocket.hpp \
common/Protocol.hpp \