|
@@ -1,10 +1,9 @@
|
|
|
-WinSW XML Configuration File
|
|
|
|
|
-====
|
|
|
|
|
|
|
+# WinSW XML Configuration File
|
|
|
|
|
|
|
|
-This page describes the configuration file, which controls the behavior of the Jenkins service.
|
|
|
|
|
|
|
+This page describes the configuration file, which controls the behavior of the Windows service.
|
|
|
|
|
|
|
|
-You can find configuration file samples in the `examples` directory of the source code repository.
|
|
|
|
|
-Actual samples are being also published as a part of releases in GitHub and NuGet.
|
|
|
|
|
|
|
+You can find configuration file samples in the [examples](../examples) directory of the source code repository.
|
|
|
|
|
+Actual samples are being also published as a part of releases on GitHub and NuGet.
|
|
|
|
|
|
|
|
## File structure
|
|
## File structure
|
|
|
|
|
|
|
@@ -12,16 +11,16 @@ The root element of this XML file must be `<service>`, and it supports the follo
|
|
|
|
|
|
|
|
Example:
|
|
Example:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <service>
|
|
|
|
|
- <id>jenkins</id>
|
|
|
|
|
- <name>Jenkins</name>
|
|
|
|
|
- <description>This service runs Jenkins continuous integration system.</description>
|
|
|
|
|
- <env name="JENKINS_HOME" value="%BASE%"/>
|
|
|
|
|
- <executable>java</executable>
|
|
|
|
|
- <arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
|
|
|
|
|
- <logmode>rotate</logmode>
|
|
|
|
|
- </service>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<service>
|
|
|
|
|
+ <id>jenkins</id>
|
|
|
|
|
+ <name>Jenkins</name>
|
|
|
|
|
+ <description>This service runs Jenkins continuous integration system.</description>
|
|
|
|
|
+ <env name="JENKINS_HOME" value="%BASE%"/>
|
|
|
|
|
+ <executable>java</executable>
|
|
|
|
|
+ <arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
|
|
|
|
|
+ <logmode>rotate</logmode>
|
|
|
|
|
+</service>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
## Environment Variable Expansion in Configuration File
|
|
## Environment Variable Expansion in Configuration File
|
|
@@ -30,33 +29,38 @@ Configuration XML files can include environment variable expansions of the form
|
|
|
Such occurrences, if found, will be automatically replaced by the actual values of the variables.
|
|
Such occurrences, if found, will be automatically replaced by the actual values of the variables.
|
|
|
If an undefined environment variable is referenced, no substitution occurs.
|
|
If an undefined environment variable is referenced, no substitution occurs.
|
|
|
|
|
|
|
|
-Also, the service wrapper sets the environment variable `BASE` by itself, which points to a directory that contains the renamed `winsw.exe`.
|
|
|
|
|
|
|
+Also, the service wrapper sets the environment variable `BASE` by itself, which points to a directory that contains the renamed *WinSW.exe*.
|
|
|
This is useful to refer to other files in the same directory.
|
|
This is useful to refer to other files in the same directory.
|
|
|
Since this is an environment variable by itself, this value can be also accessed from the child process launched from the service wrapper.
|
|
Since this is an environment variable by itself, this value can be also accessed from the child process launched from the service wrapper.
|
|
|
|
|
|
|
|
## Configuration entries
|
|
## Configuration entries
|
|
|
|
|
|
|
|
### id
|
|
### id
|
|
|
|
|
+
|
|
|
Specifies the ID that Windows uses internally to identify the service.
|
|
Specifies the ID that Windows uses internally to identify the service.
|
|
|
This has to be unique among all the services installed in a system,
|
|
This has to be unique among all the services installed in a system,
|
|
|
and it should consist entirely out of alpha-numeric characters.
|
|
and it should consist entirely out of alpha-numeric characters.
|
|
|
|
|
|
|
|
### name
|
|
### name
|
|
|
|
|
+
|
|
|
Short display name of the service, which can contain spaces and other characters.
|
|
Short display name of the service, which can contain spaces and other characters.
|
|
|
This shouldn't be too long, like `<id>`, and this also needs to be unique among all the services in a given system.
|
|
This shouldn't be too long, like `<id>`, and this also needs to be unique among all the services in a given system.
|
|
|
|
|
|
|
|
### description
|
|
### description
|
|
|
|
|
+
|
|
|
Long human-readable description of the service.
|
|
Long human-readable description of the service.
|
|
|
This gets displayed in Windows service manager when the service is selected.
|
|
This gets displayed in Windows service manager when the service is selected.
|
|
|
|
|
|
|
|
### executable
|
|
### executable
|
|
|
|
|
+
|
|
|
This element specifies the executable to be launched.
|
|
This element specifies the executable to be launched.
|
|
|
It can be either absolute path, or you can just specify the executable name and let it be searched from `PATH` (although note that the services often run in a different user account and therefore it might have different `PATH` than your shell does.)
|
|
It can be either absolute path, or you can just specify the executable name and let it be searched from `PATH` (although note that the services often run in a different user account and therefore it might have different `PATH` than your shell does.)
|
|
|
|
|
|
|
|
### startmode
|
|
### startmode
|
|
|
|
|
+
|
|
|
This element specifies the start mode of the Windows service.
|
|
This element specifies the start mode of the Windows service.
|
|
|
It can be one of the following values: Boot, System, Automatic, or Manual.
|
|
It can be one of the following values: Boot, System, Automatic, or Manual.
|
|
|
-See [MSDN](https://msdn.microsoft.com/en-us/library/aa384896%28v=vs.85%29.aspx) for details.
|
|
|
|
|
|
|
+For more information, see [ChangeStartMode method](https://docs.microsoft.com/windows/win32/cimwin32prov/changestartmode-method-in-class-win32-service).
|
|
|
The default value is `Automatic`.
|
|
The default value is `Automatic`.
|
|
|
|
|
|
|
|
### delayedAutoStart
|
|
### delayedAutoStart
|
|
@@ -68,7 +72,7 @@ Please note that this startup mode will not take affect on old Windows versions
|
|
|
Windows service installation may fail in such case.
|
|
Windows service installation may fail in such case.
|
|
|
|
|
|
|
|
```xml
|
|
```xml
|
|
|
- <delayedAutoStart/>
|
|
|
|
|
|
|
+<delayedAutoStart/>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### depend
|
|
### depend
|
|
@@ -77,9 +81,9 @@ When service `X` depends on service `Y`, `X` can only run if `Y` is running.
|
|
|
|
|
|
|
|
Multiple elements can be used to specify multiple dependencies.
|
|
Multiple elements can be used to specify multiple dependencies.
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <depend>Eventlog</depend>
|
|
|
|
|
- <depend>W32Time</depend>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<depend>Eventlog</depend>
|
|
|
|
|
+<depend>W32Time</depend>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### logging
|
|
### logging
|
|
@@ -89,73 +93,79 @@ Optionally set a different logging directory with `<logpath>` and startup `<logm
|
|
|
See the [Logging and Error reporting page](loggingAndErrorReporting.md) for more info.
|
|
See the [Logging and Error reporting page](loggingAndErrorReporting.md) for more info.
|
|
|
|
|
|
|
|
### argument
|
|
### argument
|
|
|
|
|
+
|
|
|
This element specifies the arguments to be passed to the executable.
|
|
This element specifies the arguments to be passed to the executable.
|
|
|
Winsw will quote each argument if necessary, so do not put quotes in `<argument>` to avoid double quotation.
|
|
Winsw will quote each argument if necessary, so do not put quotes in `<argument>` to avoid double quotation.
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <argument>arg1</argument>
|
|
|
|
|
- <argument>arg2</argument>
|
|
|
|
|
- <argument>arg3</argument>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<argument>arg1</argument>
|
|
|
|
|
+<argument>arg2</argument>
|
|
|
|
|
+<argument>arg3</argument>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-For backward compatibility, `<arguments>` element can be used instead to specify the whole command line in a single element.
|
|
|
|
|
|
|
+`<arguments>` element can be used instead to specify the whole command line in a single element.
|
|
|
|
|
|
|
|
### stopargument/stopexecutable
|
|
### stopargument/stopexecutable
|
|
|
-When the service is requested to stop, winsw simply calls [TerminateProcess function](http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714(v=vs.85).aspx ) API to kill the service instantly.
|
|
|
|
|
|
|
+
|
|
|
|
|
+When the service is requested to stop, winsw simply calls [TerminateProcess function](https://docs.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess) to kill the service instantly.
|
|
|
However, if `<stopargument>` elements are present, winsw will instead launch another process of `<executable>` (or `<stopexecutable>` if that's specified) with the `<stopargument>` arguments, and expects that to initiate the graceful shutdown of the service process.
|
|
However, if `<stopargument>` elements are present, winsw will instead launch another process of `<executable>` (or `<stopexecutable>` if that's specified) with the `<stopargument>` arguments, and expects that to initiate the graceful shutdown of the service process.
|
|
|
|
|
|
|
|
Winsw will then wait for the two processes to exit on its own, before reporting back to Windows that the service has terminated.
|
|
Winsw will then wait for the two processes to exit on its own, before reporting back to Windows that the service has terminated.
|
|
|
|
|
|
|
|
When you use the `<stopargument>`, you must use `<startargument>` instead of `<argument>`. See the complete example below:
|
|
When you use the `<stopargument>`, you must use `<startargument>` instead of `<argument>`. See the complete example below:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <executable>catalina.sh</executable>
|
|
|
|
|
- <startargument>jpda</startargument>
|
|
|
|
|
- <startargument>run</startargument>
|
|
|
|
|
-
|
|
|
|
|
- <stopexecutable>catalina.sh</stopexecutable>
|
|
|
|
|
- <stopargument>stop</stopargument>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<executable>catalina.sh</executable>
|
|
|
|
|
+<startargument>jpda</startargument>
|
|
|
|
|
+<startargument>run</startargument>
|
|
|
|
|
+
|
|
|
|
|
+<stopexecutable>catalina.sh</stopexecutable>
|
|
|
|
|
+<stopargument>stop</stopargument>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Note that the name of the element is `startargument` and not `startarguments`.
|
|
Note that the name of the element is `startargument` and not `startarguments`.
|
|
|
As such, to specify multiple arguments, you'll specify multiple elements.
|
|
As such, to specify multiple arguments, you'll specify multiple elements.
|
|
|
|
|
|
|
|
### stoptimeout
|
|
### stoptimeout
|
|
|
-When the service is requested to stop, winsw first attempts to [GenerateConsoleCtrlEvent function](http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155%28v=vs.85%29.aspx) (similar to Ctrl+C),
|
|
|
|
|
|
|
+
|
|
|
|
|
+When the service is requested to stop, winsw first attempts to [GenerateConsoleCtrlEvent function](https://docs.microsoft.com/windows/console/generateconsolectrlevent) (similar to Ctrl+C),
|
|
|
then wait for up to 15 seconds for the process to exit by itself gracefully.
|
|
then wait for up to 15 seconds for the process to exit by itself gracefully.
|
|
|
A process failing to do that (or if the process does not have a console),
|
|
A process failing to do that (or if the process does not have a console),
|
|
|
- then winsw resorts to calling [TerminateProcess function](http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714%28v=vs.85%29.aspx ) API to kill the service instantly.
|
|
|
|
|
|
|
+ then winsw resorts to calling [TerminateProcess function](https://docs.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess) to kill the service instantly.
|
|
|
|
|
|
|
|
This optional element allows you to change this "15 seconds" value, so that you can control how long winsw gives the service to shut itself down.
|
|
This optional element allows you to change this "15 seconds" value, so that you can control how long winsw gives the service to shut itself down.
|
|
|
See `<onfailure>` below for how to specify time duration:
|
|
See `<onfailure>` below for how to specify time duration:
|
|
|
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<stoptimeout>10sec</stoptimeout>
|
|
|
```
|
|
```
|
|
|
- <stoptimeout>10sec</stoptimeout>
|
|
|
|
|
-```
|
|
|
|
|
|
|
|
|
|
-### env
|
|
|
|
|
|
|
+### Environment
|
|
|
|
|
+
|
|
|
This optional element can be specified multiple times if necessary to specify environment variables to be set for the child process. The syntax is:
|
|
This optional element can be specified multiple times if necessary to specify environment variables to be set for the child process. The syntax is:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <env name="HOME" value="c:\abc" />
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<env name="HOME" value="c:\abc" />
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### interactive
|
|
### interactive
|
|
|
If this optional element is specified, the service will be allowed to interact with the desktop, such as by showing a new window and dialog boxes.
|
|
If this optional element is specified, the service will be allowed to interact with the desktop, such as by showing a new window and dialog boxes.
|
|
|
If your program requires GUI, set this like the following:
|
|
If your program requires GUI, set this like the following:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <interactive />
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<interactive />
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Note that since the introduction UAC (Windows Vista and onward), services are no longer really allowed to interact with the desktop.
|
|
Note that since the introduction UAC (Windows Vista and onward), services are no longer really allowed to interact with the desktop.
|
|
|
In those OSes, all that this does is to allow the user to switch to a separate window station to interact with the service.
|
|
In those OSes, all that this does is to allow the user to switch to a separate window station to interact with the service.
|
|
|
|
|
|
|
|
### beeponshutdown
|
|
### beeponshutdown
|
|
|
-This optional element is to emit [simple tone](http://msdn.microsoft.com/en-us/library/ms679277%28VS.85%29.aspx) when the service shuts down.
|
|
|
|
|
|
|
+
|
|
|
|
|
+This optional element is to emit [simple tone](https://docs.microsoft.com/windows/win32/api/utilapiset/nf-utilapiset-beep) when the service shuts down.
|
|
|
This feature should be used only for debugging, as some operating systems and hardware do not support this functionality.
|
|
This feature should be used only for debugging, as some operating systems and hardware do not support this functionality.
|
|
|
|
|
|
|
|
### download
|
|
### download
|
|
|
|
|
+
|
|
|
This optional element can be specified multiple times to have the service wrapper retrieve resources from URL and place it locally as a file.
|
|
This optional element can be specified multiple times to have the service wrapper retrieve resources from URL and place it locally as a file.
|
|
|
This operation runs when the service is started, before the application specified by `<executable>` is launched.
|
|
This operation runs when the service is started, before the application specified by `<executable>` is launched.
|
|
|
|
|
|
|
@@ -170,7 +180,7 @@ For servers requiring authentication some parameters must be specified depending
|
|
|
|
|
|
|
|
The parameter “unsecureAuth” is only effective when the transfer protocol is HTTP - unencrypted data transfer. This is a security vulnerability because the credentials are send in clear text! For a SSPI authentication this is not relevant because the authentication tokens are encrypted.
|
|
The parameter “unsecureAuth” is only effective when the transfer protocol is HTTP - unencrypted data transfer. This is a security vulnerability because the credentials are send in clear text! For a SSPI authentication this is not relevant because the authentication tokens are encrypted.
|
|
|
|
|
|
|
|
-For target servers using the HTTPS transfer protocol it is necessary, that the CA which issued the server certificate is trusted by the client. This is normally the situation when the server ist located in the Internet. When an organisation is using a self issued CA for the intranet this probably is not the case. In this case it is necessary to import the CA to the Certificate MMC of the Windows client. Have a look to the instructions on this [site](https://technet.microsoft.com/en-us/library/cc754841.aspx). The self issued CA must be imported to the Trusted Root Certification Authorities for the computer.
|
|
|
|
|
|
|
+For target servers using the HTTPS transfer protocol it is necessary, that the CA which issued the server certificate is trusted by the client. This is normally the situation when the server ist located in the Internet. When an organisation is using a self issued CA for the intranet this probably is not the case. In this case it is necessary to import the CA to the Certificate MMC of the Windows client. Have a look to the instructions on this [site](https://technet.microsoft.com/en-us/library/cc754841.aspx). The self issued CA must be imported to the Trusted Root Certification Authorities for the computer.
|
|
|
|
|
|
|
|
By default, the `download` command does not fail the service startup if the operation fails (e.g. `from` is not available).
|
|
By default, the `download` command does not fail the service startup if the operation fails (e.g. `from` is not available).
|
|
|
In order to force the download failure in such case, it is possible to specify the `failOnError` boolean attribute.
|
|
In order to force the download failure in such case, it is possible to specify the `failOnError` boolean attribute.
|
|
@@ -178,32 +188,34 @@ In order to force the download failure in such case, it is possible to specify t
|
|
|
Examples:
|
|
Examples:
|
|
|
|
|
|
|
|
```xml
|
|
```xml
|
|
|
- <download from="http://example.com/some.dat" to="%BASE%\some.dat" />
|
|
|
|
|
-
|
|
|
|
|
- <download from="http://example.com/some.dat" to="%BASE%\some.dat" failOnError="true"/>
|
|
|
|
|
|
|
+<download from="http://example.com/some.dat" to="%BASE%\some.dat" />
|
|
|
|
|
+
|
|
|
|
|
+<download from="http://example.com/some.dat" to="%BASE%\some.dat" failOnError="true"/>
|
|
|
|
|
|
|
|
- <download from="https://example.com/some.dat" to="%BASE%\some.dat" auth="sspi" />
|
|
|
|
|
|
|
+<download from="https://example.com/some.dat" to="%BASE%\some.dat" auth="sspi" />
|
|
|
|
|
|
|
|
- <download from="https://example.com/some.dat" to="%BASE%\some.dat" failOnError="true"
|
|
|
|
|
- auth="basic" user="aUser" password="aPassw0rd" />
|
|
|
|
|
|
|
+<download from="https://example.com/some.dat" to="%BASE%\some.dat" failOnError="true"
|
|
|
|
|
+ auth="basic" user="aUser" password="aPassw0rd" />
|
|
|
|
|
|
|
|
- <download from="http://example.com/some.dat" to="%BASE%\some.dat"
|
|
|
|
|
- auth="basic" unsecureAuth="true"
|
|
|
|
|
- user="aUser" password="aPassw0rd" />
|
|
|
|
|
|
|
+<download from="http://example.com/some.dat" to="%BASE%\some.dat"
|
|
|
|
|
+ auth="basic" unsecureAuth="true"
|
|
|
|
|
+ user="aUser" password="aPassw0rd" />
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
This is another useful building block for developing a self-updating service.
|
|
This is another useful building block for developing a self-updating service.
|
|
|
|
|
|
|
|
### log
|
|
### log
|
|
|
|
|
+
|
|
|
See the "Logging" section above for more details.
|
|
See the "Logging" section above for more details.
|
|
|
|
|
|
|
|
### onfailure
|
|
### onfailure
|
|
|
|
|
+
|
|
|
This optional repeatable element controls the behaviour when the process launched by winsw fails (i.e., exits with non-zero exit code).
|
|
This optional repeatable element controls the behaviour when the process launched by winsw fails (i.e., exits with non-zero exit code).
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <onfailure action="restart" delay="10 sec"/>
|
|
|
|
|
- <onfailure action="restart" delay="20 sec"/>
|
|
|
|
|
- <onfailure action="reboot" />
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<onfailure action="restart" delay="10 sec"/>
|
|
|
|
|
+<onfailure action="restart" delay="20 sec"/>
|
|
|
|
|
+<onfailure action="reboot" />
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
For example, the above configuration causes the service to restart in 10 seconds after the first failure, restart in 20 seconds after the second failure, then Windows will reboot if the service fails one more time.
|
|
For example, the above configuration causes the service to restart in 10 seconds after the first failure, restart in 20 seconds after the second failure, then Windows will reboot if the service fails one more time.
|
|
@@ -220,9 +232,12 @@ The possible suffix for the delay attribute is sec/secs/min/mins/hour/hours/day/
|
|
|
If the service keeps failing and it goes beyond the number of `<onfailure>` configured, the last action will be repeated.
|
|
If the service keeps failing and it goes beyond the number of `<onfailure>` configured, the last action will be repeated.
|
|
|
Therefore, if you just want to always restart the service automatically, simply specify one `<onfailure>` element like this:
|
|
Therefore, if you just want to always restart the service automatically, simply specify one `<onfailure>` element like this:
|
|
|
|
|
|
|
|
- <onfailure action="restart" />
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<onfailure action="restart" />
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
### resetfailure
|
|
### resetfailure
|
|
|
|
|
+
|
|
|
This optional element controls the timing in which Windows SCM resets the failure count.
|
|
This optional element controls the timing in which Windows SCM resets the failure count.
|
|
|
For example, if you specify `<resetfailure>1 hour</resetfailure>` and your service continues to run longer than one hour, then the failure count is reset to zero.
|
|
For example, if you specify `<resetfailure>1 hour</resetfailure>` and your service continues to run longer than one hour, then the failure count is reset to zero.
|
|
|
This affects the behaviour of the failure actions (see `<onfailure>` above).
|
|
This affects the behaviour of the failure actions (see `<onfailure>` above).
|
|
@@ -242,15 +257,16 @@ For more information, see [Security Descriptor Definition Language](https://docs
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Service account
|
|
### Service account
|
|
|
|
|
+
|
|
|
It is possible to specify the useraccount (and password) that the service will run as. To do this, specify a `<serviceaccount>` element like this:
|
|
It is possible to specify the useraccount (and password) that the service will run as. To do this, specify a `<serviceaccount>` element like this:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <serviceaccount>
|
|
|
|
|
- <domain>YOURDOMAIN</domain>
|
|
|
|
|
- <user>useraccount</user>
|
|
|
|
|
- <password>Pa55w0rd</password>
|
|
|
|
|
- <allowservicelogon>true</allowservicelogon>
|
|
|
|
|
- </serviceaccount>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<serviceaccount>
|
|
|
|
|
+ <domain>YOURDOMAIN</domain>
|
|
|
|
|
+ <user>useraccount</user>
|
|
|
|
|
+ <password>Pa55w0rd</password>
|
|
|
|
|
+ <allowservicelogon>true</allowservicelogon>
|
|
|
|
|
+</serviceaccount>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
The `<allowservicelogon>` is optional.
|
|
The `<allowservicelogon>` is optional.
|
|
@@ -258,39 +274,42 @@ If set to `true`, will automatically set the "Allow Log On As A Service" right t
|
|
|
|
|
|
|
|
To use [(Group) Managed Service Accounts](https://technet.microsoft.com/en-us/library/hh831782.aspx) append `$` to the account name and remove `<password>` element:
|
|
To use [(Group) Managed Service Accounts](https://technet.microsoft.com/en-us/library/hh831782.aspx) append `$` to the account name and remove `<password>` element:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <serviceaccount>
|
|
|
|
|
- <domain>YOURDOMAIN</domain>
|
|
|
|
|
- <user>gmsa_account$</user>
|
|
|
|
|
- <allowservicelogon>true</allowservicelogon>
|
|
|
|
|
- </serviceaccount>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<serviceaccount>
|
|
|
|
|
+ <domain>YOURDOMAIN</domain>
|
|
|
|
|
+ <user>gmsa_account$</user>
|
|
|
|
|
+ <allowservicelogon>true</allowservicelogon>
|
|
|
|
|
+</serviceaccount>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Working directory
|
|
### Working directory
|
|
|
|
|
+
|
|
|
Some services need to run with a working directory specified.
|
|
Some services need to run with a working directory specified.
|
|
|
To do this, specify a `<workingdirectory>` element like this:
|
|
To do this, specify a `<workingdirectory>` element like this:
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <workingdirectory>C:\application</workingdirectory>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<workingdirectory>C:\application</workingdirectory>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-### priority
|
|
|
|
|
|
|
+### Priority
|
|
|
|
|
+
|
|
|
Optionally specify the scheduling priority of the service process (equivalent of Unix nice)
|
|
Optionally specify the scheduling priority of the service process (equivalent of Unix nice)
|
|
|
Possible values are `idle`, `belownormal`, `normal`, `abovenormal`, `high`, `realtime` (case insensitive.)
|
|
Possible values are `idle`, `belownormal`, `normal`, `abovenormal`, `high`, `realtime` (case insensitive.)
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
- <priority>idle</priority>
|
|
|
|
|
|
|
+```xml
|
|
|
|
|
+<priority>idle</priority>
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Specifying a priority higher than normal has unintended consequences.
|
|
Specifying a priority higher than normal has unintended consequences.
|
|
|
-See the MSDN article [ProcessPriorityClass Enumeration](http://msdn.microsoft.com/en-us/library/system.diagnostics.processpriorityclass%28v=vs.110%29.aspx) for details.
|
|
|
|
|
|
|
+For more information, see [ProcessPriorityClass Enumeration](https://docs.microsoft.com/dotnet/api/system.diagnostics.processpriorityclass) in .NET docs.
|
|
|
This feature is intended primarily to launch a process in a lower priority so as not to interfere with the computer's interactive usage.
|
|
This feature is intended primarily to launch a process in a lower priority so as not to interfere with the computer's interactive usage.
|
|
|
|
|
|
|
|
-### stopparentprocessfirst
|
|
|
|
|
|
|
+### Stop parent process first
|
|
|
|
|
+
|
|
|
Optionally specify the order of service shutdown.
|
|
Optionally specify the order of service shutdown.
|
|
|
If `true`, the parent process is shutdown first.
|
|
If `true`, the parent process is shutdown first.
|
|
|
This is useful when the main process is a console, which can respond to Ctrl+C command and will gracefully shutdown child processes.
|
|
This is useful when the main process is a console, which can respond to Ctrl+C command and will gracefully shutdown child processes.
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
|
|
+```xml
|
|
|
<stopparentprocessfirst>true</stopparentprocessfirst>
|
|
<stopparentprocessfirst>true</stopparentprocessfirst>
|
|
|
```
|
|
```
|