views:

37

answers:

2

Hi,

  I am trying to start openOffice as a service on CentOS(non-graphical) server. 

soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1

How ever I am getting below error

Set DISPLAY environment variable, use -display option or check permissions of your X-Server (See "man X" resp. "man xhost" for details)

[1]+ Done soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp"

This command works just fine in Ubuntu. Can you please suggest how can I start OpenOffice as a service on CentOS server.

A: 

I'm not 100% sure if this is the problem, but it might be that your program cannot contact the X11 server because it was launched from the CLI. Try this:

xhost +

That enables the use of Xorg for apps launched from the CLI. I am not sure if it has to be ran as root or not (IIRC, you must NOT run it as root).

Tim Čas
When I executed the command "xhost +", I got error message xhost: 'unable to open display ""'. Just an FYI this is a non graphical centOS server. Any reason why it would run fine in Ubuntu and not in centOS.
firemonkey
+1  A: 

That works for me on CentOS 5:

  1. yum install openoffice.org-headless
  2. soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
Andrey
thank you ... it worked
firemonkey