cancel
Showing results for 
Search instead for 
Did you mean: 

Starting OpenOffice headless as user alfresco

frankg
Champ in-the-making
Champ in-the-making
Hello,

I would like to start OpenOffice 2.4 as user "alfresco". I am using the command:

sudo -H -u alfresco /opt/openoffice.org2.4/program/soffice -headless "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nofirststartwizard &

This is the output:

[1] 16819
[root@alfresco program]# Xlib: connection to ":1003.0" refused by server
Xlib: No protocol specified

/opt/openoffice.org2.4/program/soffice.bin X11 error: Can't open display: :1003.0
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

When I simply execute this command as root

opt/openoffice.org2.4/program/soffice -headless "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nofirststartwizard &


soffice starts headless in the background and i do not get any error messages in the alfresco.log and soffice is listening on port 8100 as i want it to.


Why can't user alfresco execute start soffice? I can't find any hints..
I already installed a newer version of Open Office than the one shipped with CentOS, cause I've red that CentOS' oo. can cause problems. Actually with the newer version oo. headless works for me.

Thank you very much in advance
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
This kind of question is probably better posted over on the OpenOffice.org forums… Anyway, have you made sure you downloaded the headless RPM, that doesn't require an X server (or Xvfb, etc.)..?

Mike

frankg
Champ in-the-making
Champ in-the-making
Thanks for your reply..
I already installed the headlessRPM. Other ideas?

mikeh
Star Contributor
Star Contributor
Only to try the OpenOffice forums instead…

yyovkov
Champ in-the-making
Champ in-the-making
Hi frankg,

I solved my openoffice issue as I start it separately from tomcat as a service.
What I have done is to create the init.d file called /etc/init.d/soffice with next content:

#!/bin/bash
# chkconfig: 345 20 80
# description: init.d script for headless openoffice.org (2.3+ for RHEL5 32bit)
#
# processname: soffice
#
# source function library
. /etc/rc.d/init.d/functions

RETVAL=0
SOFFICE_PATH='/usr/lib64/openoffice.org/program'
SOFFICE_ARGS='-accept="socket,host=localhost,port=8100;urp" -headless'
SOFFICE_PIDFILE=/var/run/soffice.bin.pid

start_soffice() {
       echo -n $"Starting OpenOffice.org"
       daemon $SOFFICE_PATH/soffice.bin $SOFFICE_ARGS &
       [ $? -eq 0 ] && echo_success || echo_failure
       pidof soffice.bin > $SOFFICE_PIDFILE
       echo
}
start() {
       start_soffice
}
stop() {
       echo -n $"Stopping OpenOffice"
       killproc soffice.bin
       echo
}
case "$1" in
       start)
               start
               ;;
       stop)
               stop
               ;;
       restart)
               stop
               start
               ;;
       *)
               echo $"Usage: $0 {start|stop|restart}"
esac

Then put the soffice service to start automatically after reboot, and the start it:

root $ chkconfig –add soffice
root $ chkconfi soffice on
root $ service soffice start

I hope this will help you!

Regards,
Yovko Yovkov
Solitex IBS Ltd.
http://www.solitex.biz