[osol-discuss] Please help: Running OpenOffice in headless mode (on OpenSolaris)...

2010-01-19 Thread Chris Fleischmann
Hello all, I am trying to get my openoffice code to wkr under opensolaris 
without a monitor (a.k.a headless), so far I have tried the following 
connection string in my Java code (I am using the Java SDK 3.1 kit):

oooCommand = /opt/openoffice.org3/program/soffice| -nologo -nodefault 
-norestore -nocrashreport -nolockcheck -nofirststartwizard -headless| -display 
:1 -accept=socket,host=127.0.0.1,port=8100;urp;

which is run via the following code, Runtime.getRuntime().exec(oooCommand); 
using the bootstrapconnector code that ships with the SDK.

This executable is launched from my java servlet... The ps -ef listing shows 
the following... Of course whats worth noting is that my appserver process and 
forked openoffice process is a userid, not ROOT:

chr...@opensolaris:~$ ps -ef | grep gf21
  chrisf 20003 19820   0 23:18:35 pts/1   0:00 grep gf21
gf21 19972 19971   0 23:14:19 ?   0:00 /usr/lib/ssh/sshd
gf21 19992 19990   0 23:15:01 ?   0:00 /bin/sh 
/opt/openoffice.org3/program/soffice -nologo -nodefault -norestore -noc
gf21 19180 19177   0 21:26:48 pts/1   0:00 -bash
gf21 19177 19176   0 21:26:46 ?   0:00 /usr/lib/ssh/sshd
gf21 19991 19975   0 23:14:50 pts/2   0:00 tail -f 
/opt/gf21/glassfish211/domains/domain1/logs/server.log
gf21 19975 19972   0 23:14:20 pts/2   0:00 -bash
gf21 19990 1   0 23:14:29 ?   0:19 
/usr/jdk/instances/jdk1.6.0/bin/java -Dcom.sun.aas.instanceRoot=/opt/gf21/glass
gf21 1 19992   6 23:15:02 ?   3:32 
/opt/openoffice.org3/program/soffice.bin -nologo -nodefault -norestore -nocrash

In Solaris prior to running my smf start command for glassfish, I launch the 
virtual frame buffer (Xvfb) like so;

chr...@opensolaris:~$ ps -ef | grep Xv
  chrisf 20009 19820   0 23:19:50 pts/1   0:00 grep Xv
root 18469 9   0 19:51:58 ?   0:00 /usr/X11R6/bin/Xvfb :1 
-screen 0 1024x768x24 -fbdir /tmp

Things seem to work for a period of time, or rather up until I use the 
XTextViewCursor, although it seems to continue communicating (truss'ing the 
process its def. doing something), although it never seems to come out of this 
endless loop... and my code never finishes.

However, if I run the following 2 commands from a terminal session (logged in 
as gf21 via SSH) on the headless machine it seems to work...

export DISPLAY=127.0.0.1:1.0
asadmin start-domain domain1

-

However,  I am trying to automate the starting and stopping of glassfish using 
the Solaris SMF framework which thus far, works to start/stop etc... but seems 
to fail under the headless mode for my OpenOffice code?? Is there something I 
am missing, is it because the appserver is not being kicked off from a terminal 
shell and some how not inheriting any of the environment settings (like the 
export DISPLAY above)? My SMF for starting and stopping glassfish is as below.
























   






Glassfish V2.1 Simple non-root 
user SMF






Thanks for any tips, tricks or other you may be able to provide...
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Please help: Running OpenOffice in headless mode (on OpenSolaris)...

2010-01-19 Thread Chris Fleischmann
Here below are the environment properties when I run my enable glassfish script:

g...@opensolaris:/opt/gf21$ pargs -e 20482
20482:  /usr/jdk/instances/jdk1.6.0/bin/java 
-Dcom.sun.aas.instanceRoot=/opt/gf21/glass
envp[0]: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
envp[1]: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
envp[2]: _=*9*/usr/jdk/instances/jdk1.6.0/bin/java
envp[3]: DISPLAY=192.168.1.10:1.0
envp[4]: LANG=en_US.UTF-8
envp[5]: 
LD_LIBRARY_PATH=/usr/jdk/instances/jdk1.6.0/jre/lib/i386/server:/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jdk1.6.0/jre/../lib/i386:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:
envp[6]: PATH=/usr/sbin:/usr/bin
envp[7]: PWD=/export/home/gf21
envp[8]: SHLVL=1
envp[9]: SMF_FMRI=svc:/application/glassfish/domain1:default
envp[10]: SMF_METHOD=start
envp[11]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[12]: SMF_ZONENAME=global
envp[13]: TZ=Australia/Victoria
envp[14]: A__z="*SHLVL






And here is the environment settings when I start it manually (via a SSH 
session).:

(ie., export DISPLAY=192.168.1.10; asadmin start-domain domain1)

---

g...@opensolaris:/opt/gf21$ pfexec pargs -e 20412
20412:  /usr/jdk/instances/jdk1.6.0/bin/java 
-Dcom.sun.aas.instanceRoot=/opt/gf21/glass
envp[0]: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
envp[1]: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
envp[2]: _=*20173*/usr/jdk/instances/jdk1.6.0/bin/java
envp[3]: DISPLAY=192.168.1.10:1.0
envp[4]: HOME=/export/home/gf21
envp[5]: LANG=en_US.UTF-8
envp[6]: 
LD_LIBRARY_PATH=/usr/jdk/instances/jdk1.6.0/jre/lib/i386/server:/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jdk1.6.0/jre/../lib/i386:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:
envp[7]: LOGNAME=gf21
envp[8]: MAIL=/var/mail/gf21
envp[9]: MANPATH=/usr/gnu/share/man:/usr/share/man:/usr/X11/share/man
envp[10]: OLDPWD=/export/home/gf21
envp[11]: PAGER=/usr/bin/less -ins
envp[12]: 
PATH=/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin:/opt/gf21/glassfish211/bin
envp[13]: PWD=/opt/gf21
envp[14]: SHELL=/usr/bin/bash
envp[15]: SHLVL=1
envp[16]: SSH_CLIENT=150.101.163.93 62672 22
envp[17]: SSH_CONNECTION=150.101.163.93 62672 192.168.1.10 22
envp[18]: SSH_TTY=/dev/pts/1
envp[19]: TERM=xterm-color
envp[20]: TZ=Australia/Victoria
envp[21]: USER=gf21
envp[22]: A__z="*SHLVL

Thanks again for any help or support you may be able to provide...
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Please help: Running OpenOffice in headless mode (on OpenSolaris)...

2010-01-19 Thread Chris Fleischmann
And lastly the pargs -e for the openoffice script, when starting manually (not 
through SMF), I get:

envp[0]: URE_BOOTSTRAP=file:///opt/openoffice.org3/program/fundamentalrc
envp[1]: _=*20644*/opt/openoffice.org3/program/soffice.bin
envp[2]: DISPLAY=192.168.1.10:1.0
envp[3]: HOME=/export/home/gf21
envp[4]: LANG=en_US.UTF-8
envp[5]: 
LD_LIBRARY_PATH=/usr/jdk/instances/jdk1.6.0/jre/lib/i386/client:/usr/jdk/instances/jdk1.6.0/jre/lib/i386/native_threads:/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jdk1.6.0/jre/lib/i386/server:/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jdk1.6.0/jre/../lib/i386:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:
envp[6]: LOGNAME=gf21
envp[7]: MAIL=/var/mail/gf21
envp[8]: MANPATH=/usr/gnu/share/man:/usr/share/man:/usr/X11/share/man
envp[9]: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
envp[10]: PAGER=/usr/bin/less -ins
envp[11]: 
PATH=/opt/openoffice.org3/program:/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin:/opt/gf21/glassfish211/bin
envp[12]: PWD=/opt/gf21/glassfish211/domains/domain1/config
envp[13]: SAL_ENABLE_FILE_LOCKING=1
envp[14]: SHELL=/usr/bin/bash
envp[15]: SHLVL=1
envp[16]: SSH_CLIENT=192.18.17.40 45065 22
envp[17]: SSH_CONNECTION=192.18.17.40 45065 192.168.1.10 22
envp[18]: SSH_TTY=/dev/pts/2
envp[19]: TERM=xterm-color
envp[20]: TZ=Australia/Victoria
envp[21]: USER=gf21
envp[22]: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt


compared to the pargs -e after starting glassfish VIA SMF:

chr...@opensolaris:~$ pfexec pargs -e 20595
20595:  /opt/openoffice.org3/program/soffice.bin -nologo -nodefault -norestore 
-nocrash
envp[0]: URE_BOOTSTRAP=file:///opt/openoffice.org3/program/fundamentalrc
envp[1]: _=*20588*/opt/openoffice.org3/program/soffice.bin
envp[2]: DISPLAY=192.168.1.10:1.0
envp[3]: LANG=en_US.UTF-8
envp[4]: 
LD_LIBRARY_PATH=/usr/jdk/instances/jdk1.6.0/jre/lib/i386/client:/usr/jdk/instances/jdk1.6.0/jre/lib/i386/native_threads:/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jdk1.6.0/jre/lib/i386/server:/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jdk1.6.0/jre/../lib/i386:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:/opt/gf21/glassfish211/lib:
envp[5]: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
envp[6]: PATH=/opt/openoffice.org3/program:/usr/sbin:/usr/bin
envp[7]: PWD=/opt/gf21/glassfish211/domains/domain1/config
envp[8]: SAL_ENABLE_FILE_LOCKING=1
envp[9]: SHELL=/usr/bin/bash
envp[10]: SHLVL=1
envp[11]: SMF_FMRI=svc:/application/glassfish/domain1:default
envp[12]: SMF_METHOD=start
envp[13]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[14]: SMF_ZONENAME=global
envp[15]: TERM=xterm-color
envp[16]: TZ=Australia/Victoria
envp[17]: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
envp[18]: A__z="*SHLVL

Once again any help muchly appreciated...
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


[osol-discuss] SOLVED Please help: Running OpenOffice in headless mode (on OpenSolaris)...

2010-01-19 Thread Chris Fleischmann
SOLVED folks... perseverance is key...:

I added the following envars to my GlassFish SMF one by one comparing manual to 
the SMF way and seeing what happens...:


  
  
  
  
  
  

  
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org