Commit graph

19 commits

Author SHA1 Message Date
Ashod Nakashian
5c9988f2e3 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>
2020-07-01 05:42:43 +02:00
Michael Meeks
b0403c7d45 Copy linked /etc/localtime (and also timezone) into the systemplate.
Change-Id: I77fc24aa0f2fc94ee889a87bc10332c85ea57808
2019-10-25 11:24:33 +01:00
Andras Timar
1dbc88a32b Fix domain name resolution from jail by adding required libs to systemplate
Originally all was good, then ad21717498
removed these files from jail, therefore name resolution broke, then
ac7d67f43e added back libnss_* libs from one location, which
happened to work on developer's computer, then 4e5528e5f8,
b4f15c714a, and 9c0ab72155
added back etc/hosts etc/nsswitch.conf etc/resolv.conf that were also needed for proper
name resolution, finally this patch adds some more possible locations of Name Service
Switch (NSS) libs, therefore it makes sure that the required libnss_* shared libs
are found e.g. on Debian based systems. Also, testing with libreoffice/online docker image
has shown that libresolv.so.2 is also required in systemplate for name resolution, although
on some other systems it was not needed (preload?).

This fixes two bugs:
1) Linked images in documents were not displayed on certain systems
2) Insert image from WOPI host did not work on certain systems

Change-Id: I5d09a65341050f0f729bdbc46977c0f686ac023c
Reviewed-on: https://gerrit.libreoffice.org/64426
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-12-02 18:32:34 +01:00
Andras Timar
052c033e92 tdf#121429 PDF writing needs NSS libs in systemplate (2)
Change-Id: I3724114867986a7ff2494b6b360b1680d7661bcc
2018-11-22 14:28:21 +01:00
Andras Timar
9606c29d64 tdf#121429 PDF writing needs NSS libs in systemplate
Change-Id: I478058168d8288a1e9bced66ba58b1bb26e556bb
Reviewed-on: https://gerrit.libreoffice.org/63721
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-11-21 21:59:40 +01:00
Andras Timar
9c0ab72155 typo: missing backslash
Change-Id: I194420d64a2541000e6bc7eb52d3cec8883e32d4
2018-11-01 17:25:44 +01:00
Andras Timar
b4f15c714a Fix networking in the chroot (again)
Change-Id: I60a6f5f99577e4336b1ec117e28650d677ed7d63
2018-11-01 17:17:40 +01:00
Andras Timar
4e5528e5f8 /etc/resolv.conf can be a symlink
Change-Id: I23396e598306b7c8ab1498962ab5c09150c6795b
Reviewed-on: https://gerrit.libreoffice.org/62674
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-10-30 21:33:03 +01:00
Jan Holesovsky
ac7d67f43e Fix networking in the chroot.
The needed files were not copied, and consequently the hostname
resolution did not work in the chroot.

Change-Id: Id3dccc4f70cd1deeddb83c8e672f240e06748e34
2018-08-03 05:22:03 +02:00
Andras Timar
6c42c2bc91 redirect stderr of find to /dev/null, non existing search paths can be ignored
Change-Id: Icf2a77f8cd78da2f9d4ff7adc11308cb96464e65
2018-06-15 15:04:25 +02:00
Michael Meeks
ad21717498 Avoid copying most code into the chroot jail.
Last lingering bits are the xpdfimport import support and
some horrors required for NSS.

This requires a reasonably new core.

Change-Id: I2e08b841668722af0e3b947cf2b06687cca73b53
2018-03-28 16:38:10 +01:00
Michael Meeks
501d36824b Clean up un-used pcf fonts from the systemplate to shrink it.
Also drop ~/docs/ copying for devs - too generic a name.

Change-Id: Ib9416e23fa7f09ec923e03551c6c7b85bc3defe3
2018-03-10 13:50:43 +00:00
Andras Timar
61a2d94f2b copy system hyphenation dictionaries to systemplate
Change-Id: Ie7e5a2644436d5de61f65b2d8ec5201471100787
2017-10-30 11:01:14 +01:00
Andras Timar
017f82a84d no error if systemplate dir is existing
Change-Id: I10aba648688ba92150efa41449190a3ba425f03c
Reviewed-on: https://gerrit.libreoffice.org/42663
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-09-22 17:10:26 +02:00
Andras Timar
478e803819 add xpdfimport dependencies (e.g. system libpoppler) to systemplate
Change-Id: Iedb77cc0eed107899b15d3d471edcfa0f655d176
2017-07-31 19:39:50 +02:00
Samuel Mehrbrodt
0b129c05a9 Find libpng on Ubuntu also
Change-Id: Ib0ed1b26ddac1aca6381650c85e17a4b1a6d017f
Reviewed-on: https://gerrit.libreoffice.org/35749
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-03-27 10:03:07 +00:00
Henry Castro
6e7f8b860d script: remove POCO libraries from systemplate
This is no longer need it
2017-01-05 17:05:08 -04:00
Henry Castro
8fdee3fca8 script: copy additional documents
This is only for debugging purpose
2016-12-16 23:38:32 -04:00
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Renamed from loolwsd/loolwsd-systemplate-setup (Browse further)