<?xml version="1.0"?>
<!DOCTYPE configuration SYSTEM "dtd/Configuration.dtd">
<configuration name="KernelTasks" version="1.0" os="OS4">
  <package name="com.sap.sdt.tools" version="1.0"/>

  <task name="COPY_BINARIES" type="fs">
      <!-- Exchange unpacked binaries: -->
      <copy toDir="$(TARGET_DIR)" overwrite="true" type="kerneldir" id="CopyBinaries">
          <fileset dir="$(SOURCE_DIR)/kernel">
              <include name="*"/>
          </fileset>
      </copy>
  </task>

  <task name="COPY_BINARIES_OS4_POST" type="extProcess">
	  <!-- td.bin.29-->
	<process executable="system -e -k APYSIDKRN SID($(/J2EE/StandardSystem/SAPSystemName)) ARCHIVES('$(/J2EE/StandardSystem/ExecutableDirectory)') MODE(*ILE) LOGPATH('$(JSPM/DIR/LOG)/CALL_APYSIDKRN_TEMP.LOG')"
      dir="$(/J2EE/StandardSystem/ExecutableDirectory)" stdout="$(JSPM/DIR/LOG)/APYSID_OS4.OUT" stderr="$(JSPM/DIR/LOG)/APYSID_OS4.ERR" id="RunApysidkrnOs4">
      <checkRC result="FATAL">
        <values invert="true">
          <single value="0"/>
        </values>
        <message>Applying of the new kernel failed</message>
      </checkRC>
    </process>
	  <!-- td.BIN.19 crtsapusr for sidadm otherwise START_SHD_SCS and start_SHD_J2EE_DM will fails (R3INLPGM: Error occured setting gid to R3GROUP)-->
	  <process 
		executable="system CRTSAPUSR USER(*ADM) SID($(/J2EE/StandardSystem/SAPSystemName))"
		dir="$(JSPM/DIR/TMP)"
		stdout="$(JSPM/DIR/LOG)/CRTSAPUSR_SIDADM.OUT"
		stderr="$(JSPM/DIR/LOG)/CRTSAPUSR_SIDADM.ERR"
		id="SwitchUserSidadm">
		<checkRC result="FATAL">
		  <values invert="true">
			<single value="0"/>
		  </values>
		  <message>Command CRTSAPUSR completed with error. See $(/JSPM/DIR/LOG)/CRTSAPUSR_SIDADM.* for details.</message>
		</checkRC>
	  </process>
  </task>
  
  <task name="CLEAN_TEMP_VARS" type="fs">
      <delete file="$(/JSPM/DIR/DATA/VAR)/Os4ArchiveInfo.xml" id="CleanTempVars"/>
  </task>

  <task name="DROP_OLD_SAPSTARTSRV_LOG_OS4" type="fs">
      <delete file="$(/J2EE/StandardSystem/ServiceInstance/WorkingDirectory)/sapstart.log" id="DropSapStartSrvScs"/>
      <delete file="$(/J2EE/StandardSystem/CentralInstance/WorkingDirectory)/sapstart.log" id="DropSapStartSrvJ2ee"/>
  </task>

</configuration>
