The WASService command line tool enables you create a service for a product Java™ process on Linux® and Windows® operating systems.
When the installation wizard creates a service, the uninstaller program can remove the service. If you use the WASService command to create a service yourself, it is your responsibility to remove the service when it is no longer valid. The uninstaller program does not remove services that you create with the WASService command.
The wasservice.sh command
file is located in the app_server_root\bin directory.
The WASService.exe command
file is located in the app_server_root\bin directory.
The command syntax is as follows:
wasservice.sh -start service_name [optional startServer.bat parameters]
WASService.exe -start service_name [optional startServer.bat parameters]
The command syntax is as follows:
wasservice.sh -add service_name -serverName server_name -profilePath server_profile_directory [-wasHome app_server_root] [-startArgs additional_start_arguments] [-stopArgs additional_stop_arguments] [-userid user_id -password password]
WASService.exe -add service_name -serverName server_name -profilePath server_profile_directory [-wasHome app_server_root] [-configRoot configuration_repository_directory] [-startArgs additional_start_arguments] [-stopArgs additional_stop_arguments] [-userid user_id -password password] [-logFile service_log_file] [-logRoot server_log_directory] [-restart true | false] [-startType automatic | manual | disabled]
The command syntax is as follows:
wasservice.sh -remove service_name
WASService.exe -remove service_name
The command syntax is as follows:
wasservice.sh -stop service_name [optional stopServer.bat parameters]
WASService.exe -stop service_name [optional stopServer.bat parameters]
The command syntax is as follows:
wasservice.sh -status service_name
WASService.exe -status service_name
The following parameters are required with this command:
WASService -encodeParams service_name
The name of the service that is created by the installation wizard is IBM® WebSphere Application Server V6.x - DefaultNode.
To view services, open the Control panel and click Administrative Tools > Services. Select a service to view information about it. Right click the service and click Properties. Four tabs provide information and functionality. For example, select the Setup type field on the General tab to change the setup type.
This example creates a service called IBM WebSphere Application Server V6.x - name_of_the_application_server_service that starts an application server process:
WASService -add name_of_the_application_server_service -servername application_server_name -profilePath profile_root -wasHome app_server_root -logFile profile_root\logs\WS_startServer.log -logRoot profile_root\logs\application_server_name -restart truewhere
After entering the command, messages that are similar to those in the following example display in the command window:
Adding Service: name_of_the_application_server_service Config Root: profile_root\config Server Name: application_server_name Profile Path: profile_root Was Home: app_server_root Start Args: Restart: 1 IBM WebSphere Application Server V6.x - name_of_the_application_server_service service successfully added.
This example for the Windows operating system updates an existing service called IBM WebSphere Application Server V6.x - Server2 Service with additional stop arguments, the user name and password. The parameters are automatically passed into the script that the Windows service uses to shutdown the system.
WASService -add "Server2 Service" -servername server2 -profilePath profile_root -logRoot profile_root\logs\server2 -stopArgs "-username user_name -password password" -encodeParams
For this Windows operating system example, if you issue the startServer server1 command or the stopServer server1 after creating a Windows service for server1, a message that is similar to the following example displays:
Because server1 is registered to run as a Windows Service, the request to start this server will be completed by starting the associated Windows Service.