From 09cdb0a0ec12026ae43d830b935ed2c53cb680cc Mon Sep 17 00:00:00 2001 From: NextTurn <45985406+NextTurn@users.noreply.github.com> Date: Fri, 20 Dec 2019 00:00:00 +0800 Subject: [PATCH] Support and --- doc/xmlConfigFile.md | 13 ++--- examples/sample-allOptions.xml | 2 +- src/Core/ServiceWrapper/Main.cs | 24 ++++---- .../Configuration/DefaultSettings.cs | 4 +- .../Configuration/IWinSWConfiguration.cs | 4 +- src/Core/WinSWCore/ServiceDescriptor.cs | 57 +++++++++++++------ 6 files changed, 62 insertions(+), 42 deletions(-) diff --git a/doc/xmlConfigFile.md b/doc/xmlConfigFile.md index aebd65d..e843f3a 100644 --- a/doc/xmlConfigFile.md +++ b/doc/xmlConfigFile.md @@ -92,9 +92,9 @@ Optionally set a different logging directory with `` and startup `` element specifies the arguments to be passed to the executable. Winsw will quote each argument if necessary, so do not put quotes in `` to avoid double quotation. ```xml @@ -107,12 +107,12 @@ Winsw will quote each argument if necessary, so do not put quotes in ` ### stopargument/stopexecutable -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 `` elements are present, winsw will instead launch another process of `` (or `` if that's specified) with the `` arguments, and expects that to initiate the graceful shutdown of the service process. +~~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 ``/`` elements are present, winsw will instead launch another process of `` (or `` if that's specified) with the specified 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. -When you use the ``, you must use `` instead of ``. See the complete example below: +When you use the ``/``, you must use ``/`` instead of ``. See the complete example below: ```xml catalina.sh @@ -123,9 +123,6 @@ When you use the ``, you must use `` instead of `stop ``` -Note that the name of the element is `startargument` and not `startarguments`. -As such, to specify multiple arguments, you'll specify multiple elements. - ### stoptimeout When the service is requested to stop, winsw first attempts to send a Ctrl+C signal, diff --git a/examples/sample-allOptions.xml b/examples/sample-allOptions.xml index 47ac8a5..dc87cc2 100644 --- a/examples/sample-allOptions.xml +++ b/examples/sample-allOptions.xml @@ -157,7 +157,7 @@ SECTION: Executable management This OPTION also enables termination of the executable via stop executable --> + -stop true -->