cancel
Showing results for 
Search instead for 
Did you mean: 

OpenOffice not listening 8100 on boot, kills transformations

hikenboots
Champ in-the-making
Champ in-the-making
(This is an issue with openoffice, not alfresco, I'm just hoping someone who is using openoffice has seen this before.  I'm out of ideas.)

The problem is that when the server starts, openoffice is not listening on port 8100 so transformations fail.  A simple manual shutdown and restart of Alfresco (to consequently shutdown and restart openoffice) and openoffice is listening properly on 8100 and transformations work great.

The server has no GUI, I installed OO via RPM on FC4 and completed the registration box via Xvfb.  ( I selected never register. )  I get the main main frame of the openoffice app without the registration box on subsequent starts of soffice.  Done as root.

The start sequence is really simple: /etc/rc.d/rc.local sets up the java variables and starts alfresco, which in turn starts openoffice via start_oo.sh.  Why does openoffice refuse to listen on 8100 when initiated from init but works great when /etc/rc.d/rc.local  is run manually?

login as: root
root@192.168.1.1's password:
Last login: Tue Mar 21 09:17:08 2006 from 192.168.1.20
Login after a reboot to see if OpenOffice is listening on 8100…

[root@hq ~]# ps -A | grep office
2442 ?        00:00:00 soffice
2511 ?        00:00:00 soffice.bin
OO started but isn't assigned to a pty as per the "?"

[root@hq ~]# netstat -a | grep 8100
[root@hq ~]#
OO is NOT listening on 8100

[root@hq ~]# killall Xvfb
[root@hq ~]#
Shut down alfresco for a manual restart of alfresco/OO/Xvfb

[root@hq ~]# /opt/alfresco/alfresco.sh stop
Using CATALINA_BASE:   /opt/alfresco/tomcat
Using CATALINA_HOME:   /opt/alfresco/tomcat
Using CATALINA_TMPDIR: /opt/alfresco/tomcat/temp
Using JRE_HOME:       /usr/local/jdk1.5.0_02
Using JAVA_OPTS:       -Xms128m -Xmx512m -server -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

-Djava.util.logging.config.file=/opt/alfresco/tomcat/conf/logging.properties
Shut down alfresco for a manual restart of alfresco/OO/Xvfb

[root@hq ~]# ps -A | grep office
[root@hq ~]#
openoffice is shut down.

[root@hq ~]# /etc/rc.d/rc.local

[root@hq ~]# Using CATALINA_BASE:   /opt/alfresco/tomcat
Using CATALINA_HOME:   /opt/alfresco/tomcat
Using CATALINA_TMPDIR: /opt/alfresco/tomcat/temp
Using JRE_HOME:       /usr/local/jdk1.5.0_02
Using JAVA_OPTS:       -Xms128m -Xmx512m -server -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

-Djava.util.logging.config.file=/opt/alfresco/tomcat/conf/logging.properties
Starting Xvfb…
Starting OpenOffice service…
Start up Alfresco/OpenOffice/Xvfb just like init did…

[root@hq ~]# ps -A | grep office
7344 pts/1    00:00:00 soffice
7358 pts/1    00:00:01 soffice.bin
openoffice is running. Of course we get a pty this time.  Could this be the problem somehow?

[root@hq ~]# netstat -a | grep 8100
tcp        0      0 localhost.localdomain:8100  *:*                         LISTEN
tcp        0      0 localhost.localdomain:8100  localhost.localdomain:58434 ESTABLISHED
tcp        0      0 localhost.localdomain:8100  localhost.localdomain:34711 ESTABLISHED
tcp        0      0 localhost.localdomain:8100  localhost.localdomain:33161 ESTABLISHED
tcp        0      0 localhost.localdomain:34711 localhost.localdomain:8100  ESTABLISHED
tcp        0      0 localhost.localdomain:33161 localhost.localdomain:8100  ESTABLISHED
tcp        0      0 localhost.localdomain:58434 localhost.localdomain:8100  ESTABLISHED
openoffice IS listening now!  Why does it work from a manual start but not from a reboot??

[root@hq ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

JAVA_HOME=/usr/local/jdk1.5.0_02
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH

cd /opt/alfresco
/opt/alfresco/alfresco.sh start &
rc.local for reference

[root@hq ~]# cat /opt/alfresco/start_oo.sh
#!/bin/sh
# —————————————————————————
# Start script for the OpenOffice transform service
# —————————————————————————

export DISPLAY=:1
echo "Starting Xvfb…"
`/usr/X11R6/bin/Xvfb -fp /usr/X11R6/lib/X11/fonts/misc :1 -screen 0 800x600x16 -fbdir /usr/src` &

echo "Starting OpenOffice service…"
cd /opt/openoffice.org2.0/program
/opt/openoffice.org2.0/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager -nologo -headless -display :1" &
start_oo for reference as well

[root@hq ~]#
4 REPLIES 4

hikenboots
Champ in-the-making
Champ in-the-making
Sorry to answer my own question here.  I got it to work after a whole day of testing and want to share my results.  I think that headless openoffice needs to be able to find a user's folder to run correctly.  Starting it explicitly as a user using `su - aUser -c` allows it to do so.  Pure supposition on my part, but it's working.

If your openoffice won't listen on 8100 after a reboot, try modifying start_oo.sh as follows:

#!/bin/sh
# —————————————————————————
# Start script for the OpenOffice transform service
# —————————————————————————

export DISPLAY=:1
echo "Starting Xvfb…"
`/usr/X11R6/bin/Xvfb -fp /usr/X11R6/lib/X11/fonts/misc :1 -screen 0 800x600x16 -fbdir /usr/src` &

echo "Starting OpenOffice service…"
cd /opt/openoffice.org2.0/program
su - root -c "/opt/openoffice.org2.0/program/soffice \"-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager -norestore -invisible -headless -display :1\" &"

abichet
Champ in-the-making
Champ in-the-making
hi
i try your code but i have an error:

SRV-PROJETS:/usr/local/alfresco# ./start_oo.sh
Starting Xvfb…
Starting OpenOffice service…
SRV-PROJETS:/usr/local/alfresco# I18N: Operating system doesn't support locale "en_US"
/opt/openoffice.org2.0/program/soffice.bin X11 error: Can't open display:
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

hikenboots
Champ in-the-making
Champ in-the-making
Hi Arnaud,

Two questions: Are you installing OpenOffice on a linux box where the only installed GUI is Xvfb?  (I've never tried it on a machine where anything other than Xvfb installed.)  Also, if so, were you able to get OpenOffice registered and successfully running transformations as per http://forums.alfresco.com/viewtopic.php?t=1036&highlight=xvfb first?

hi
i try your code but i have an error:

SRV-PROJETS:/usr/local/alfresco# ./start_oo.sh
Starting Xvfb…
Starting OpenOffice service…
SRV-PROJETS:/usr/local/alfresco# I18N: Operating system doesn't support locale "en_US"
/opt/openoffice.org2.0/program/soffice.bin X11 error: Can't open display:
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

fajo
Champ in-the-making
Champ in-the-making
I experienced the same on SunOS 5.9 using Xvfb - after some investigation I found, that the problem was caused by a X server reset after the the last client session has disconnected.

OO seems to connect multiple times - but only one session is kept open. After the first session disconnects there are no more sessions open and the X server performs a reset that causes the next connection attempt to fail.

A possible workaround is to start a small X application (xclock,…) first after the X server has started. This will keep at least one connection open and OO will not comlain any longer. Do not forget to set the right display number (either via -display :<n> oder the DISPLAY env) for the X application you are using.