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 19999 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.
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='glassfish:domain1'>
<service name='application/glassfish/domain1' type='service' version='1'>
<create_default_instance enabled='true' />
<single_instance />
<dependency name='fs-local' grouping='require_all' restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<dependency name='network-service' grouping='require_all'
restart_on='none' type='service'>
<service_fmri value='svc:/network/service' />
</dependency>
<dependency name='xvfb-server' grouping='require_all' restart_on='none'
type='service'>
<service_fmri value='svc:/snapon/xvfb-server:default' />
</dependency>
<method_context>
<method_credential user='gf21' group='gf21'
privileges='basic,net_privaddr'/>
</method_context>
<exec_method type='method' name='start'
exec='/opt/gf21/glassfish211/bin/asadmin start-domain domain1'
timeout_seconds='600'/>
<exec_method type='method' name='stop'
exec='/opt/gf21/glassfish211/bin/asadmin stop-domain domain1'
timeout_seconds='600' />
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient' />
</property_group>
<stability value='Unstable' />
<template>
<common_name>
<loctext xml:lang='C'>Glassfish V2.1 Simple non-root
user SMF</loctext>
</common_name>
</template>
</service>
</service_bundle>
Thanks for any tips, tricks or other you may be able to provide...
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]