Configure processes definition using wsadmin
The following example modifies the process definition of a server...
Using Jacl...
set server [$AdminConfig getid /Cell:cell/Node:node/Server:server/] ### Identify the process definition belonging to this server ### There are two ways to do this... set processDef [$AdminConfig list JavaProcessDef $server] ### or set processDef [$AdminConfig showAttribute $server processDefinition] ### Change the working directory... $AdminConfig modify $processDef {{workingDirectory /tmp/user1}} ### Modify the stderr file name... set errFile [list stderrFilename \${LOG_ROOT}/server/new_stderr.log] set attr [list $errFile] $AdminConfig modify $processDef [subst {{ioRedirect {$attr}}}] ### Modify the process priority... $AdminConfig modify $processDef {{execution {{processPriority 15}}}} ### Change the maximum startup attempts... $AdminConfig modify $processDef {{monitoringPolicy {{maximumStartupAttempts 1}}}} $AdminConfig save
Using Jython
server = AdminConfig.getid('/Cell:cell/Node:node/Server:server/') print server processDef = AdminConfig.list('JavaProcessDef', server) print processDef processDef = AdminConfig.showAttribute(server, 'processDefinition') AdminConfig.modify(processDef, [['workingDirectory', '/tmp/user1']]) errFile = ['stderrFilename', '\${LOG_ROOT}/server/new_stderr.log'] attr = [errFile] AdminConfig.modify(processDef, [['ioRedirect', [attr]]]) AdminConfig.modify(processDef, [['execution', [['processPriority', 15]]]]) AdminConfig.modify(processDef, [['monitoringPolicy', [['maximumStartupAttempts', 1]]]]) AdminConfig.save()