I am looking for an admin command or script to disable the automatic start of applications hosted by a WAS.
I found via the web interface in the following menus: Application -> Application Types -> Websphere Enterprise Applications -> Click on the App -> Details Properties: "Target specific application status" -> Select cluster and click on "Disable Auto start".
But no way to find a command line corresponding to this action.
Can you help me ?
Thank you in advance,
You can use the "wsadminlib.py" scripting library to do this easily, it contains a function for setDeploymentAutoStart with signature:
Here is the signature and doc:
def setDeploymentAutoStart(deploymentname, enabled, deploymenttargetname=None):
"""Sets an application to start automatically, when the server starts.
Specify enabled as a lowercase string, 'true' or 'false'.
For example, setDeploymentAutoStart('commsvc', 'false')
Returns the number of deployments which were found and set successfully.
Raises exception if application is not found.
You may optionally specify an explicit deployment target name, such as a server or cluster name.
For example, setDeploymentAutoStart('commsvc', 'true', deploymenttargetname='cluster1')
setDeploymentAutoStart('commsvc', 'false', deploymenttargetname='server1')
If the deployment target name is not specified, autostart is set on all instances of the deployment.
Ultimately, this method changes the 'enable' value in a deployment.xml file. For example,
<targetMappings xmi:id="DeploymentTargetMapping_1262640302437" enable="true" target="ClusteredTarget_1262640302439"/>
"""
Using wsadminlib.py is as easy as downloading it from github, launching wsadmin, then running execfile /path/to/wsadminlib.py
Then you just need to sort out the parameters you want and call the function above.