You can use the wsadmin tool to configure processes in
your application server configuration. Enhance the operation of an
application server by defining command-line information for starting
or initializing the application server process. Process definition
settings define runtime properties such as the program to run, arguments
to run the program, and the working directory.
About this task
There are three ways to perform this task. Complete the
steps in this task to use the setProcessDefinition command for the
AdminTask object or the AdminConfig object to modify your process
definition configuration. Alternatively, you can use the configureProcessDefinition
Jython script in the AdminServerManagement script library to configure
process definition attributes. The wsadmin tool automatically loads
the script when the tool starts. Use the following syntax to configure
process definition settings using the configureProcessDefinition script:
AdminServerManagement.configureProcessDefintion(nodeName, serverName, otherParamList)
For additional information and argument
definitions, see the documentation for the AdminServerMananagment
script library.
Procedure
- Start the wsadmin scripting tool.
- Use the setProcessDefinition command for the AdminTask
object or the AdminConfig object to modify your process definition
configuration.
- Use the following example to configure the process definition
with the setProcessDefinition command for the AdminTask object:
- Use the following steps to configure the process definition with
the AdminConfig option:
- Identify the server and assign it to the s1 variable,
as the following example demonstrates:
Table 1. AdminConfig getid command description. The previous commands consist of the following elements:
| Element |
Description |
| set |
Jacl command |
| s1 |
Variable name |
| $ |
Jacl operator for substituting a variable name
with its value |
| AdminConfig |
Object that represents the WebSphere® Application Server configuration |
| getid |
AdminConfig command |
| Cell |
Object type |
| mycell |
Name of the object that will be modified |
| Node |
Object type |
| mynode |
Name of the object that will be modified |
| Server |
Object type |
| server1 |
Name of the object that will be
modified |
| print |
Jython command |
Example output:
server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
- Identify the process definition for the server of interest, and
assign it to the processDef variable, as the following example
displays:
- Using Jacl:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
set processDef [$AdminConfig list JavaProcessDef $s1]
set processDef [$AdminConfig showAttribute $s1 processDefinitions]
- Using Jython:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
processDef = AdminConfig.list('JavaProcessDef', s1)
print processDef
processDef = AdminConfig.showAttribute(s1, 'processDefinitions')
Example output:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
(cells/mycell/nodes/mynode/servers/server1|server.xml#JavaProcessDef_1)
- Modify the configuration attributes for the process definition.
The following example changes the working directory:
- Using
Jacl:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
$AdminConfig modify $processDef {{workingDirectory c:/temp/user1}}
- Using
Jython:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
AdminConfig.modify(processDef, [['workingDirectory', 'c:/temp/user1']])
The following example modifies the name of the
stderr file:
- Using
Jacl:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
set errFile [list stderrFilename \${LOG_ROOT}/server1/new_stderr.log]
set attr [list $errFile]
$AdminConfig modify $processDef [subst {{ioRedirect {$attr}}}]
- Using
Jython:
![[AIX Solaris HP-UX Linux Windows]](../images/ngdist.svg)
errFile = ['stderrFilename', '\${LOG_ROOT}/server1/new_stderr.log']
attr = [errFile]
AdminConfig.modify(processDef, [['ioRedirect', [attr]]])
The following example modifies the process priority level:
- Using
Jacl:
$AdminConfig modify $processDef {{execution {{processPriority 15}}}}
- Using
Jython:
AdminConfig.modify(processDef, [['execution', [['processPriority', 15]]]])
The following example changes the maximum number of times the product tries to start an
application server in response to a start request. If the server cannot be started within the
specified number of attempts, an error message is issued that indicates that the application server
could not be started.
- Using
Jacl:
$AdminConfig modify $processDef {{monitoringPolicy {{maximumStartupAttempts 1}}}}
- Using
Jython:
AdminConfig.modify(processDef, [['monitoringPolicy', [['maximumStartupAttempts', 1]]]])
The following examples show how to reset the process command argument values such as
startCommandArgs, stopCommandArgs,
executableArguments, and terminateCommandArgs.
Use the
AdminConfig.resetAttributes() command to reset the startCommandArgs argument with
a new value.
- Using
Jacl:
$AdminConfig resetAttributes $processDef {{"startCommandArgs", "JOBNAME=CCCCC,ENV=WAS00.NDN1.BBOS001,REUSASID=YES"}}
- Using
Jython:
AdminConfig.resetAttributes(processDef, '[[startCommandArgs "JOBNAME=CCCCC,ENV=WAS00.NDN1.BBOS001,REUSASID=YES"]]')
Use the
AdminConfig.modify() command to unset and reset the attribute value:
- Using
Jacl:
$AdminConfig modify $processDef {{"startCommandArgs", ""}}
$AdminConfig modify $processDef {{"startCommandArgs", "JOBNAME=CCCCC,ENV=WAS00.NDN1.BBOS001,REUSASID=YES"}}
- Using
Jython:
AdminConfig.modify(processDef ,'[[startCommandArgs ""]]')
AdminConfig.modify(ProcessDef, '[[startCommandArgs "JOBNAME=BBOS0011,ENV=WAS00.NDN1.BBOS001,REUSASID=YES"]]')
- Save the configuration changes.
Use the following command example to save your configuration
changes:
AdminConfig.save()