Centos – How to start open-office headless service on a particular port in CentOS

centoscentos6liferayopenoffice

I am trying the following to start OpenOffice headless service:

soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;"

I have tried with double-dash -- instead of single - and this command just hangs and the prompt never comes:

soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;"

I have installed openoffice by following this link and it seems to be installed correctly as checked through rpm -qa | less which shows all the openoffice packages.

I have even tried removing it and installing again, which also completes without any error.

But the service is not getting started, I have checked through:

# netstat -tulpn | grep :8100
# netstat -tulpn

But I don't see any service listening on the port: 8100.

Can you let me know what am I doing wrong? I need this for integration with Liferay. Portal.

Environment: CentOS 6.2, 64-bit.

Thanks

Best Answer

(update your OS... no excuse to be running EL6.2 today)

I have the LibreOffice (formerly OpenOffice) headless server running on some of my production systems for batch processing of .XLS documents.

The init script used for this is available here.

The running command line looks like the following. Port selection should be self-explanatory:

/usr/lib64/libreoffice/program/soffice.bin --headless --accept=socket,host=localhost,port=8100;urp;

The necessary packages are:

# rpm -aq | grep libreoffice | sort
libreoffice-calc-4.0.4.2-9.el6.x86_64
libreoffice-core-4.0.4.2-9.el6.x86_64
libreoffice-headless-4.0.4.2-9.el6.x86_64
libreoffice-opensymbol-fonts-4.0.4.2-9.el6.noarch
libreoffice-pyuno-4.0.4.2-9.el6.x86_64
libreoffice-ure-4.0.4.2-9.el6.x86_64
libreoffice-writer-4.0.4.2-9.el6.x86_64