Re: (resolved) Re: [libreoffice-users] libreoffice grabs network port

2022-04-25 Thread Dave Howorth
On Mon, 25 Apr 2022 17:05:12 +0100
Mike Scott  wrote:

[snip]
 
> All's well that end's well, I guess. Mojolicious has a steep learning 
> curve, but is much easier and cleaner to use than php for this job.
> LO works, albeit slowly -- ~20 seconds to do the .odt->.doc
> conversion on a pi4.
> 
> Again, thanks.

Glad to hear it's been solved :) Yes, all the MVC templating systems
have bits of weirdness that have to be learned the hard way :(
Mojolicious is not one I ever used.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy



(resolved) Re: [libreoffice-users] libreoffice grabs network port

2022-04-25 Thread Mike Scott

On 22/04/2022 15:38, Dave Howorth wrote:



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()?


Sorry, should have said it's a wrapper for perl's open3() (itself a 
wrapper for system() ) which runs the given command. But see below.

.


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



Thanks for the reply. I've been banging my head against a wall, because 
all of mojolicious, perl's IPC and LO are to varying degrees unfamiliar. 
I certainly mis-understood what I was seeing, processes running LO and 
with the web network port listening: it's actually correct and harmless.


The problem is now resolved, and at the root was related to running the 
program detached as a daemon. I had a web server running LO internally, 
which ran correctly from a terminal; ran correctly when detached with 
magic using () and shell redirects; but which failed when run "properly" 
with freebsd's 'daemon' command.


Obvious in hindsight, the issue was that the daemon, running as user 
www, didn't have access to a writeable home directory, so LO couldn't 
run because it needs a rather large file tree there. That was compounded 
with my misunderstanding of perl's open3() error handling.


I'm now using the -env:UserInstallation=XX option to give LO a 
temporary place to put its bits and bobs, and all - finally - seems to 
function. At least, LO runs and does the conversions. I do wonder why 
there's an oosplash process started when I'm using --nologo and 
--headless though! It also creates more soffice.bin processes than I'd 
expect, but they seem to tidy themselves away eventually.


I'm not sure why I had so much trouble here, compared to a couple of 
years ago, when I was running LO from apache/php without particular bother.


All's well that end's well, I guess. Mojolicious has a steep learning 
curve, but is much easier and cleaner to use than php for this job. LO 
works, albeit slowly -- ~20 seconds to do the .odt->.doc conversion on a 
pi4.


Again, thanks.




--
Mike Scott
Harlow, Essex, England

--
Mike Scott (unet2  [deletethis] scottsonline.org.uk)
Harlow Essex England
"The only way is Brexit" -- anon.

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] libreoffice grabs network port

2022-04-22 Thread Dave Howorth
On Fri, 22 Apr 2022 15:05:53 +0100
Mike Scott  wrote:

> 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 :-| 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

> TIA.
>
> Linux mint, btw, ooo 6.4.7.2

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy



[libreoffice-users] libreoffice grabs network port

2022-04-22 Thread Mike Scott

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 :-| 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


--
Mike Scott (unet2  [deletethis] scottsonline.org.uk)
Harlow Essex England
"The only way is Brexit" -- anon.

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy