C:\winnt\system32\sc.exe create
service-name
binPath= \
"
fully-qualified-path-to-appservService.exe
\
"
fully-qualified-path-to-asadmin.bat start-command
\
"
\
"
fully-qualified-path-to-asadmin.bat stop-command
\
""
start= auto DisplayName=
"
display-name
"
Note –
There is no space between
binpath
and the equals sign (=). There must be a space after
the equals sign and before the path.
For example, to create a service called
SunJavaSystemAppServer DOMAIN1
that starts and stops
the domain
domain1
, using a password file
C:\Sun\AppServer\password.txt
:
C:\windows\system32\sc.exe create domain1 binPath=
"
C:\Sun\AppServer\lib\appservService.exe \
"
C:\Sun\AppServer\bin\asadmin.bat
start-domain --user admin --passwordfile C:\Sun\AppServer\password.txt domain1\
"
\
"
C:\Sun\AppServer\bin\asadmin.bat stop-domain domain1\
""
start= auto
DisplayName=
"
SunJavaSystemAppServer DOMAIN1
"
To create a service that starts and stops the node agent
agent1
:
C:\windows\system32\sc.exe create agent1 binPath=
"
C:\Sun\AppServer\lib\appservAgentService.exe \
"
C:\Sun\AppServer\bin\asadmin.bat
start-node-agent --user admin --passwordfile C:\Sun\AppServer\password.txt agent1\
"
\
"
C:\Sun\AppServer\bin\asadmin.bat stop-node-agent agent1\
""
start= auto
DisplayName=
"
SunJavaSystemAppServer AGENT1
"
Note –
The start and stop commands entered as part of the
binPath=
parameter must have the
correct syntax. To test, run the commands from the command prompt. If the commands do not
properly start or stop the domain or node agent, the service does not work correctly.
Note –
Don’t use a mixture of
asadmin start
and
stop
commands and service start and stops.
Mixing the two can cause the server status to be out of sync. For example, the service might not
show that the component has started even though the component is not running. To avoid this
situation, always use the
sc.exe
command to start and stop the component when using
services.
If your sc.exe create command did not properly create the service, delete the service and try
again. To delete the service, use the
sc.exe delete
"
service-name
"
command.
Restarting Automatically on the Microsoft Windows Platform
Sun GlassFish Enterprise Server 2.1 Administration Guide • December 2008
224
Содержание Sun GlassFish Enterprise Server 2.1
Страница 12: ...12 ...
Страница 13: ...Figures FIGURE 1 1 Enterprise Server Instance 29 FIGURE 9 1 RoleMapping 105 13 ...
Страница 14: ...14 ...
Страница 18: ...18 ...
Страница 38: ...38 ...
Страница 62: ...62 ...
Страница 96: ...96 ...
Страница 126: ...126 ...
Страница 160: ...160 ...
Страница 214: ...214 ...
Страница 218: ...218 ...
Страница 230: ...230 ...