libreoffice grabs network port

Hi all. A bit of a saga for me.

I'm using LO headless from within a web server.

The server is the perl-based mojolicious, and calls LO do do some file conversions from .odt to .doc and pdf.

LO is called like:
runcmd( 'soffice', '--headless', '--convert-to', $filter, '--outdir', $outdir, $odtfile );

followed by a call to mojo's render() stuff to pass the file to the user.

Which often works.

But (with varying frequency) LO seems to grab the web server's port somehow and sets up its own listen on it. This somewhat damages the web link :expressionless: I've seen multiple copies of soffice and oosplash listening on the same port (a high-numbered, obscure one). I can't even see how this is possible

The question is, why does it do this, and how do I stop it?

TIA.

Linux mint, btw, ooo 6.4.7.2

Hi all. A bit of a saga for me.

I'm using LO headless from within a web server.

The server is the perl-based mojolicious, and calls LO do do some
file conversions from .odt to .doc and pdf.

LO is called like:
runcmd( 'soffice', '--headless', '--convert-to', $filter, '--outdir',
$outdir, $odtfile );

followed by a call to mojo's render() stuff to pass the file to the
user.

Which often works.

But (with varying frequency) LO seems to grab the web server's port
somehow and sets up its own listen on it. This somewhat damages the
web link :expressionless: I've seen multiple copies of soffice and oosplash
listening on the same port (a high-numbered, obscure one). I can't
even see how this is possible

The question is, why does it do this, and how do I stop it?

What investigation have you done? Why do you think the problem is with
LO rather than with mojolicious or somewhere in between?

Also, what is runcmd()?

Steps I would be thinking of trying:
(1) add debugging prints to the mojolicious code so you can see exactly
what arguments are passed on each occasion
(2) for some case where the problem occurs run LO directly from the
command line with the same arguments and see if the problem occurs