SMF in Solaris wont write to stderr/stdout ?

Hi,
I got a process (c written) that we usually run this way :

EmsChkQu >> /EMS/log/EmsChkQu.log 2>&1

When trying to use it as a service I defined it this way :

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
  <service name='site/EmsChkQu' type='service' version='0'>
    <create_default_instance enabled='true'/>
    <single_instance/>
    <dependency name='network' grouping='require_all' restart_on='error' type='service'>
      <service_fmri value='svc:/milestone/network:default'/>
    </dependency>
    <dependency name='filesystem' grouping='require_all' restart_on='error' type='service'>
      <service_fmri value='svc:/system/filesystem/local'/>
    </dependency>
    <dependency name='Active_Server' grouping='require_all' restart_on='refresh' type='path'>
      <service_fmri value='file://localhost/EMS/log/I_AM_THE_ACTIVE_CMS'/>
    </dependency>
    <method_context project=':default' resource_pool=':default' working_directory='/EMS/bin'>
      <method_credential group='root' limit_privileges=':default' privileges=':default' supp_groups=':default' user='root'/>
    </method_context>
    <exec_method name='start' type='method' exec='/EMS/bin/EmsChkQu >>/EMS/log/EmsChkQu.log 2>&1' timeout_seconds='60'>
      <method_context>
        <method_environment>
          <envvar name='LOGNAME' value='root' />
          <envvar name='SYBASE' value='/EMS/sybase'/>
          <envvar name='LIB' value='/EMS/sybase/OCS-15_0/lib:'/>
          <envvar name='PATH' value='.:/EMS/bin:/usr/ccs/bin:/usr/local/bin:/EMS/sybase/ASE-15_0/jobscheduler/bin:/EMS/sybase/ASE-15
_0/bin:/EMS/sybase/ASE-15_0/install:/EMS/sybase/SCC-3_2/bin:/EMS/sybase/DBISQL/bin:/EMS/sybase/OCS-15_0/bin:/usr/sbin:/usr/bin'/>
          <envvar name='LD_LIBRARY_PATH' value='/EMS/sybase/ASE-15_0/lib:/EMS/sybase/DataAccess64/ODBC/lib:/EMS/sybase/DataAccess64/
ODBC/dm/lib64:/EMS/sybase/OCS-15_0/lib:/EMS/sybase/OCS-15_0/lib3p64:/EMS/sybase/OCS-15_0/lib3p:'/>
          <envvar name='LD_LIBRARY_PATH_64' value='/EMS/sybase/ASE-15_0/lib:/EMS/sybase/DataAccess64/ODBC/lib:/EMS/sybase/DataAccess
64/ODBC/dm/lib64:/EMS/sybase/OCS-15_0/lib:/EMS/sybase/OCS-15_0/lib3p64:/EMS/sybase/OCS-15_0/lib3p:'/>
          <envvar name='SYBASE_ASE' value='ASE-15_0'/>
          <envvar name='SYBASE_OCS' value='OCS-15_0'/>
          <envvar name='iSYBASE_JRE7' value='/EMS/sybase/shared/JRE-7_0_7'/>
          <envvar name='SYBASE_JRE7' value='/EMS/sybase/shared/JRE-7_0_7'/>
          <envvar name='SYBASE_JRE7_32' value='/EMS/sybase/shared/JRE-7_0_7'/>
          <envvar name='SYBASE_JRE7_64' value='/EMS/sybase/shared/JRE-7_0_7'/>
          <envvar name='HOME' value='/EMS/bin'/>
          <envvar name='stderr' value='/EMS/log/EmsChkQu.log' />
          <envvar name='stdout' value='/EMS/log/EmsChkQu.log' />
        </method_environment>
      </method_context>
    </exec_method>
    <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'>
      <method_context/>
    </exec_method>
    <property_group name='startd' type='framework'>
      <propval name='duration' type='astring' value='child'/>
      <propval name='ignore_error' type='astring' value='core,signal'/>
    </property_group>
    <property_group name='application' type='application'/>
    <stability value='Evolving'/>
    <template>
      <common_name>
        <loctext xml:lang='C'>EmsChkQu</loctext>
      </common_name>
    </template>
  </service>
</service_bundle>

Unfortunately, the svccfg return a parsing error, how can I redirect stdout/stderr to a file or my choice ?

You might simply create a wrapper script that handle the redirections and define it as the smf method. e.g.:

#!/bin/ksh
exec /EMS/bin/EmsChkQu >>/EMS/log/EmsChkQu.log 2>&1

Well, thats what I wanted to avoid ...

Then have your C written program handling the redirection itself when called by smf.

This is not an option, I'm not allowed to modify the code.
On Digital VMS system, we used to redefine the SYS$OUTPUT environment variable, why cant I do the same here ?

Just use a wrapper, that's the simpler way to fix your service or explain why that would not fit your requirements.

Because in UNIX and Linux shells, SYS$OUTPUT is not an environment variable; it is the string SYS concatenated with the contents of the environment variable OUTPUT . Most UNIX and Linux shells redirect input and output streams using redirections on the command line.

If you'd like to port a Digital VMS system shell to Solaris and, then you can use the SYS$OUTPUT environment variable to redirect output when you invoke programs from that shell.

It is just like not being able to use IBM mainframe JCL commands to run most programs on UNIX and Linux systems (the dd utility being an obvious exception).