Exporting CLASSPATH in manifest service file

Hi,

I need the a help can please any one give me a suggestion for Exporting the CLASS PATH in service manifest file for Solaris 10

Here i have pasted the code

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!-- Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. ident "@(#) 1.0 07/12/10 SMI" -->

<service_bundle type='manifest' name='SGSN_Service'>
<service
name='application/SGSN_Service'
type='service'
version='1'>

<create_default_instance enabled='false' />
<single_instance />

<method_context>
<method_environment>
<envvar name="SGSN_STREAMBASE_HOME" value="/opt/SGSN/StreamBase" />
<envvar name="SGSN_HOME" value="/opt/SGSN" />
<envvar name="LD_LIBRARY_PATH" value="/opt/SGSN/StreamBase/lib" />
<envvar name="CLASSPATH" value="some path"
</method_environment>

</method_context>
<exec_method
type='method'
name='start'
exec='$SGSN_STREAMBASE_HOME/bin/sbd -f $SGSN_HOME/bin/sgsn.sbconf $SGSN_HOME/bin/sgsn-application.sbapp >> $SGSN_HOME/log/SGSN.log 2>&1 &'
timeout_seconds='60' />
<exec_method
type='method'
name='stop'
exec=':kill -TERM'
timeout_seconds='60' />
</service>

</service_bundle>

In the above code i want to write code to export the CLASSPATH
for this i have written like below:

<exec_method
type='method'
name='start'
exec='export $CLASSPATH'
exec='$SGSN_STREAMBASE_HOME/bin/sbd -f $SGSN_HOME/bin/sgsn.sbconf $SGSN_HOME/bin/sgsn-application.sbapp >> $SGSN_HOME/log/SGSN.log 2>&1 &'
timeout_seconds='60' />

But the above code also not working (I am not sure whether the above way is correct or not if anybody have some other way please let me know)

please tell me how can i do that

All of the environment variables in the method_environment section should be automatically exported, otherwise they would be pointless... so you shouldn't need to export CLASSPATH manually.

Thank you very much... your sol worked for me.
But i have one more issue .. Please let me know that how can I execute the Unix commands in manifest service file. I need to change the working directory. I need to execute the command 'cd /opt/SGSN/bin' is there any way for this?

Thanks In Advace :slight_smile:

Try changing this line as follows:

exec='cd $SSGN_HOME/bin ; $SGSN_STREAMBASE_HOME/bin/sbd -f $SGSN_HOME/bin/sgsn.sbconf $SGSN_HOME/bin/sgsn-application.sbapp >> $SGSN_HOME/log/SGSN.log 2>&1 &'

thank you very much