Libreoffice headless option

Hi,

I have been trying to convert a doc file to text file but headless option is
giving errors and still looking for X files.

I have tried numerous options but am getting errors.

/opt/libreoffice3.5/program/soffice --invisible --convert-to
/opt/libreoffice3.5/program/oosplash: error while loading shared libraries:
libXinerama.so.1: cannot open shared object file: No such file or directory

/opt/libreoffice3.5/program/soffice --headless --nologo --nofirststartwizard
--invisible
/opt/libreoffice3.5/program/oosplash: error while loading shared libraries:
libXinerama.so.1: cannot open shared object file: No such file or directory

/opt/libreoffice3.5/program/soffice.bin --headless --nologo
--nofirststartwizard --invisible -nodefault
/opt/libreoffice3.5/program/soffice.bin: error while loading shared
libraries: libXrender.so.1: cannot open shared object file: No such file or
directory

All these commands are looking for an X server. How can I avoid it?

Thanks,

Hi :slight_smile:
Sorry no-one has been able so answer this so far!  We have had a rather overwhelming sudden increase in activity on this list in the last couple of days.  Hopefully someone here has experience with being headless all the time rather than just using it to open LO up as a gui. 
Regards from
Tom :slight_smile:

merter <serdar@hebux.com> writes:

All these commands are looking for an X server. How can I avoid it?

I don't believe it's actually looking for a server, rather it just
needs a library related to X11. When run in headless mode, no
communication with an X server will take place, but since the LO
binary you have (and probably most if not all standard/dist *nix LO
builds) have been linked with the X libraries, the loader still needs
to be able to resolve the libraries.

It is possible, if rebuilding LO from source, to compile without any
X11 support at all, but there may still be some other library
dependencies (on, say, fonts) that you'd still need to satisfy. And
building from source can be pretty non-trivial the first time.

Simpler is to just install the X11 support libraries. There's no need
to actually run an X server, just have the libraries available. I'm
assuming you've installed LO manually (since I would expect a
distribution package to have dependencies built in), so you could run
ldd on the installed soffice.bin to double check what libraries you
are missing and then install the appropriate packages from your
distribution.

-- David

Hi,

Yes, I installed them manually using the DEB packages.

I tried to install those dependencies but it is now silently failing and
giving no output whatsoever. I tried to debug it with my poor gdb skills,
but gdb log is saying;

Program exited with code 0115.
No stack.

By the way, I have installed openoffice, and it's soffice is working
correctly, but I'd like to use libreoffice if possible.

If I can debug and see why it is failing, I can do so, but I don't know how
to do.

Thanks,

David Bolen wrote

merter &lt;serdar@&gt; writes:

All these commands are looking for an X server. How can I avoid it?

I don't believe it's actually looking for a server, rather it just
needs a library related to X11. When run in headless mode, no
communication with an X server will take place, but since the LO
binary you have (and probably most if not all standard/dist *nix LO
builds) have been linked with the X libraries, the loader still needs
to be able to resolve the libraries.

It is possible, if rebuilding LO from source, to compile without any
X11 support at all, but there may still be some other library
dependencies (on, say, fonts) that you'd still need to satisfy. And
building from source can be pretty non-trivial the first time.

Simpler is to just install the X11 support libraries. There's no need
to actually run an X server, just have the libraries available. I'm
assuming you've installed LO manually (since I would expect a
distribution package to have dependencies built in), so you could run
ldd on the installed soffice.bin to double check what libraries you
are missing and then install the appropriate packages from your
distribution.

-- David

--
For unsubscribe instructions e-mail to: users+help@.libreoffice
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be
deleted

David Bolen wrote

merter &lt;serdar@&gt; writes:

All these commands are looking for an X server. How can I avoid it?

I don't believe it's actually looking for a server, rather it just
needs a library related to X11. When run in headless mode, no
communication with an X server will take place, but since the LO
binary you have (and probably most if not all standard/dist *nix LO
builds) have been linked with the X libraries, the loader still needs
to be able to resolve the libraries.

It is possible, if rebuilding LO from source, to compile without any
X11 support at all, but there may still be some other library
dependencies (on, say, fonts) that you'd still need to satisfy. And
building from source can be pretty non-trivial the first time.

Simpler is to just install the X11 support libraries. There's no need
to actually run an X server, just have the libraries available. I'm
assuming you've installed LO manually (since I would expect a
distribution package to have dependencies built in), so you could run
ldd on the installed soffice.bin to double check what libraries you
are missing and then install the appropriate packages from your
distribution.

-- David

--
For unsubscribe instructions e-mail to: users+help@.libreoffice
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be
deleted

David Bolen wrote

Hi :slight_smile:
This wiki-page might help
http://wiki.documentfoundation.org/BugReport

I have not tried looking at it with a command-line web-browser such as; links, lynx, netrik, surfraw(?), w3m (has ipv6 support) and probably others as i was only looking through the standard Ubuntu repos which are more tuned into gui apps.

Anyway, hopefully the wiki-page might help get strace (or whatnot as the space-station reporter often says)
Regards from
Tom :slight_smile:

I will repeat what I think that you are saying so that I can better understand

In your current trials you are attempting to do something that:

1. Fails with the latest release of LibreOffice (LO).

2. Works in OOo. Do you mean the latest Apache OpenOffice (AOO), or legacy OOo?

If this is the case, then there was likely a version of LO where this did work. You could potentially determine which release of LO actually broke what you are trying to do. Might be helpful to the bug fixers.

Hi,

Thanks for the replies, they've been really helpful. Yes it is failing with
the latest version of Libreoffice and works with the latest version of AOO.

I am also not able to install an X server, but I could drill down what's
causing the issue. It seems the issue is the package dependency of Debian
packages.

I have selectively installed the Debian packages I want, like calc, writer
etc, and their dependencies. I haven't used any command like force and if
the package required an another package, I installed it too. However, when
using strace I've seen a couple of missing files, which come with other
packages.

My current list of installed packages;

libobasis3.5-base
libobasis3.5-calc
libobasis3.5-core01
libobasis3.5-core02
libobasis3.5-core03
libobasis3.5-core04
libobasis3.5-core05
libobasis3.5-core06
libobasis3.5-core07
libobasis3.5-images
libobasis3.5-impress
libobasis3.5-ooofonts
libobasis3.5-pyuno
libobasis3.5-writer
libreoffice3.5
libreoffice3.5-calc
libreoffice3.5-impress
libreoffice3.5-ure
libreoffice3.5-writer

The missing package was libobasis3.5-en-us_3.5.3-2_amd64.deb. I re-checked
all these installed packages and none of them has a dependency to that file.
It now seems an obvious file to install but since I trusted the dependency
system, I missed it.

Now it is working correctly. Should I file a bug report to the bugzilla?

Thanks for your help,

David Bolen wrote

merter <serdar@hebux.com> writes:

The missing package was libobasis3.5-en-us_3.5.3-2_amd64.deb. I re-checked
all these installed packages and none of them has a dependency to that file.
It now seems an obvious file to install but since I trusted the dependency
system, I missed it.

I think that's because you haven't installed any of the language
packs, which is what depend on that module (it's the base module for a
given language).

There should be a top level "libreoffice3.5-en-us_xxx" package which
pulls in all the per-component language packages, including the base
one you installed manually here. I'd probably go ahead and install
the top level package and pick up all the language packages just to be
safe, although for the most part en-us should be the same as that
built into the code.

I suppose the main packages don't want to depend on any specific
language, so selecting a language module is a top level choice (e.g.,
one of the libreoffice* packages) in and of itself. Given that some
language pack is needed, I suppose it would be nice if the component
packages depended on a virtual language support package or something.

BTW, assuming that you are installing the debs as downloaded directly
from TDF, personally I'd just recommend installing them all and not
worrying too much about trying to cherry pick, unless you're being
really selective. There's an awful lot of shared code among the
various components; once you're going to be including all the *core*
packages, you aren't really optimizing that much by cherry picking
beyond that.

For example, in my 3.5.4 install (direct from TDF), just the packages
you listed represent almost 80% of the space used by installing
everything. All of the work to cherry pick only saves about 85MB of
disk space.

-- David

Hi,

I see. Yes I am installing the deb packages downloaded from TDF.

Optimisation was the main reason I was cherry picking the packages, and
since Libreoffice comes with separate packages instead of one single
package, I thought it is encouraged when needed. Our old system is a 1.5
years old server which is using the legacy OOo. We are in process of
migrating the conversion server so I wanted to move to libreoffice for this
new setup.

Our old server has converted more than 100.000 files using jodconverter and
since Libreoffice comes with --convert-to argument, I also want to update
the conversion scripts to use this new native option and eliminate the
potential performance issues which come with the jodconverter. (Though we
didn't have any performance issues with the old setup since we don't convert
thousands of files daily, but native is almost always better right :))

I'll install the remaining packages to ensure the system stability. Disk
space was never an issue since we have 3 TB of space in this server,
optimisation was the main reason.

Thanks again for your help. This community is amazing. :slight_smile:

David Bolen wrote

Hi :slight_smile:
Is it the Debian packagers that need to know about this?  I think they are the ones that choose which other packages are listed as dependencies of packages in their repos?
Regards from
Tom :slight_smile: