Commit graph

79 commits

Author SHA1 Message Date
Tor Lillqvist
b276c3541c Probably we should pass loTemplate to globalPreinit(), not loSubPath
globalPreinit() does not run in a chroot as far as I see, so trying to
use loSubPath as an absolute path will not work. Probably what was
meant is loTemplate, then the libraries at least are found.
2016-02-15 22:59:03 +02:00
Tor Lillqvist
c62d612562 Clean up error reporing
If neither libsofficeapp.so or libmerged.so exist where we look for
them, say so explicitly.

Log the error message from dlerror(), too.

Log the mesage about not forking in all cases when doing that, not
just if lok_preinit is not found.

Execing is not an alternative to fork(), spawning is.
2016-02-15 22:33:56 +02:00
Henry Castro
cdcb32f013 loolwsd: loolbroker drop capabilities 2016-02-14 14:54:04 -04:00
Henry Castro
72db8ed63a loolwsd: replace the random jail id for lokit process id 2016-02-13 19:01:03 -04:00
Henry Castro
75b552bf71 loolwsd: create named pipes workspace 2016-02-13 13:22:15 -04:00
Henry Castro
9e3d5c0337 loolwsd: ensure chroot jail every lokit process 2016-02-13 10:15:28 -04:00
Tor Lillqvist
9a15bc6c2c Zero is a valid return value from open()
Sure, it is highly likely that fd 0 is already in other use, but let's
be correct.
2016-02-12 14:01:10 +02:00
Tor Lillqvist
d19433c3b8 Bin unused macros 2016-02-12 13:31:32 +02:00
Henry Castro
5848cff634 loolwsd: wait for loolbroker process to change state 2016-02-03 19:51:27 -04:00
Henry Castro
8469343da1 loolwsd: avoid fork a new child when its exit code is not success 2016-02-03 18:34:27 -04:00
Henry Castro
70ff592624 loolwsd: use strsignal 2016-02-03 18:08:16 -04:00
Henry Castro
661ae62259 loolwsd: exit when error no child process 2016-02-03 17:43:04 -04:00
Henry Castro
b7ee46f729 loolwsd: child exit codes are required before fork new lokit process 2016-02-03 17:35:35 -04:00
Henry Castro
1fc3d06e37 loolwsd: fix iterator erase 2016-02-03 17:15:20 -04:00
Henry Castro
3cda799328 loolwsd: avoid the loolbroker block forever before lokit launch 2016-02-03 17:07:36 -04:00
Henry Castro
58fa747bb4 loolwsd: avoid a broken lokit process block the loolbroker forever 2016-02-03 16:59:09 -04:00
Henry Castro
5fd2be332a loolwsd: use EXIT_SOFTWARE to indicate internal error 2016-02-01 21:53:16 -04:00
Ashod Nakashian
f3b319ee7f loolwsd: each HTTPServer has its params and skip failed child query
Change-Id: I41c730a935fd0d2e1e3181cced529d414c3aebb0
Reviewed-on: https://gerrit.libreoffice.org/22014
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-02 01:51:04 +00:00
Henry Castro
b477f41636 loolwsd: add fatal signals handler 2016-02-01 21:26:19 -04:00
Ashod Nakashian
57240993b6 loolwsd: removed url cache in favor of unified child cache
Change-Id: I44d07ea3e03a78a6038322c8110f66dd9c161957
Reviewed-on: https://gerrit.libreoffice.org/21975
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:04:38 +00:00
Ashod Nakashian
b596c80e34 loolwsd: simplified child searching
Change-Id: I0d817876f5b83acff69e51c2c64cd6acfa8dc27d
Reviewed-on: https://gerrit.libreoffice.org/21974
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:02:35 +00:00
Ashod Nakashian
450bf8eebe loolwsd: correct pre-spawn childs
Change-Id: Id306176296dde6f63821041eae1b28d23637f18d
Reviewed-on: https://gerrit.libreoffice.org/21934
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:43:38 +00:00
Ashod Nakashian
a2357fbb8b loolwsd: replacing URL cache
Change-Id: I98d754fabdb0f136e31af3852c1cdf1af4ead503
Reviewed-on: https://gerrit.libreoffice.org/21932
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:42:46 +00:00
Ashod Nakashian
4861bb75f2 loolwsd: child process termination and cleanup
Change-Id: Ib43202dbde92c0223096bad1b9b4d491484b88e0
Reviewed-on: https://gerrit.libreoffice.org/21931
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:41:35 +00:00
Ashod Nakashian
49ae5b5943 loolwsd: encapsulate child processes in a single object
Change-Id: I2f382c4c2c224d42359e11929423866e41f88526
Reviewed-on: https://gerrit.libreoffice.org/21930
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:40:50 +00:00
Henry Castro
aad79ea3c5 loolwsd: ensure response PID child 2016-01-26 23:28:42 -04:00
Henry Castro
faf2a57d19 loolwsd: eof broker pipe 2016-01-26 21:22:07 -04:00
Miklos Vajna
1d6d0741f0 loolwsd: -Werror,-Wtautological-constant-out-of-range-compare 2016-01-25 13:08:37 +01:00
Ashod Nakashian
75ede04cd7 loolwsd: improved child forking
Change-Id: Ic05b412bb9c467659c24cba12f385ed9c0c67b84
Reviewed-on: https://gerrit.libreoffice.org/21758
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:11:54 +00:00
Ashod Nakashian
55f2105f00 loolwsd: logging improvements
Change-Id: I77844a2b549c1f497c2d44f054169bf11d9227d8
Reviewed-on: https://gerrit.libreoffice.org/21752
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:00:34 +00:00
Ashod Nakashian
ef2ec0b2e2 loolwsd: fixes to broker threading and communication
Broker cache clean up is now done only during searching
as there we loop over processes and request status
from each child.

Internal helpers simplified and termination is done
in a single removeChild helper.

Change-Id: I31f7df5429f0737d352842d5c0f6a02b91b8078f
Reviewed-on: https://gerrit.libreoffice.org/21751
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 20:59:40 +00:00
Ashod Nakashian
a882ed1aa1 loolwsd: thread safety fixes in broker
Change-Id: Ibfff184ad294c14d6583f7a8282edc4e2742ad52
Reviewed-on: https://gerrit.libreoffice.org/21685
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:07:02 +00:00
Ashod Nakashian
23ca0f0d77 loolwsd: detect child termination by signal as well as exit
Change-Id: Ic4dc89a7ad1470cc7afbd763b904b617b36e62aa
Reviewed-on: https://gerrit.libreoffice.org/21681
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:03:53 +00:00
Ashod Nakashian
d2bde985cc loolwsd: poll timeout of 500ms and handling priority events
Change-Id: Iadf449ee62700e1ac5da2be8c73c674657633808
Reviewed-on: https://gerrit.libreoffice.org/21679
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:02:04 +00:00
Ashod Nakashian
6b24eb7bba loolwsd: PIPE_BUFFER -> READ_BUFFER_SIZE = 2048
Change-Id: I12e9725549a15b2cb1c287db9de0fca732dafac2
Reviewed-on: https://gerrit.libreoffice.org/21678
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 15:59:47 +00:00
Ashod Nakashian
ad7509d449 loolwsd: writeFIFO overload to take std::string
Change-Id: Ibfac97d1d4f101a10bd0f696b8b89a22170b1b11
Reviewed-on: https://gerrit.libreoffice.org/21672
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 15:43:11 +00:00
Ashod Nakashian
0632da5edb loolwsd: reworked child management and load balancing in broker
Change-Id: I92874d1aeb8fe46f3bbc1cb9d3b2b9d46632f4b9
Reviewed-on: https://gerrit.libreoffice.org/21473
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-14 13:56:40 +00:00
Ashod Nakashian
bdd3f73bd5 loolwsd: misc child cleanup
Change-Id: I5ed100e053925264db2cb8f60de67cf6a536a65b
Reviewed-on: https://gerrit.libreoffice.org/21470
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-14 13:40:40 +00:00
Ashod Nakashian
5bf75f56ca loolwsd: centralized signal handling and eased debugging
Change-Id: Ifdb3e2bca540bec3c6dea1ab24173c8ea0267706
Reviewed-on: https://gerrit.libreoffice.org/21325
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-11 04:06:56 +00:00
Ashod Nakashian
b2b983476c loolwsd: more informative warnings
Change-Id: I8dba6d003bd5c0b3c16b3cd57c3737638ce56bd1
Reviewed-on: https://gerrit.libreoffice.org/21320
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-11 04:04:02 +00:00
Henry Castro
f3c8ace597 loolwsd: request abnormal termination 2016-01-09 12:26:04 -04:00
Henry Castro
f3735f145f loolwsd: force kills a child with abnormal state. 2016-01-08 23:34:34 -04:00
Henry Castro
584e68e6d1 loolwsd: remove expired session URL cached 2016-01-08 19:05:58 -04:00
Henry Castro
b213464b3d loolwsd: ensure unique URL per lokit process 2016-01-07 14:55:11 -04:00
Ashod Nakashian
0b5bc5f244 loolwsd: random jailId dir created by WSD and renamed childId -> jailId
Change-Id: Ib5ce65c578c0c7fd3dbf81628906cd17728fb3ff
Reviewed-on: https://gerrit.libreoffice.org/21182
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:56:01 +00:00
Ashod Nakashian
9285f50c6b loolwsd: kit instance forkCounter now atomic
Change-Id: I04470220b83940319ff1a0fee865201433f44016
Reviewed-on: https://gerrit.libreoffice.org/21167
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-06 17:04:42 +00:00
Andras Timar
faa1fa47c7 loowsd: typo: falied -> failed 2016-01-06 11:11:23 +01:00
Andras Timar
e41e25a18c loolwsd: bccu#1397 fix dlopening LO in loolbroker in mergedlibs case 2016-01-06 10:38:09 +01:00
Henry Castro
fe3b4fc9a4 loolwsd: when no available child sessions, pre spawns more children 2016-01-05 08:51:05 -04:00
Ashod Nakashian
99500542b9 loolwsd: new kit processes created and improved search
Change-Id: Ife2075f6e06febc8bd95eb5d9c0774fd48fbdc8c
Reviewed-on: https://gerrit.libreoffice.org/21099
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-05 01:14:59 +00:00