Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
91bd9d0 Provide the WinSW service manager
WinSW is a useful tool that can wrap any application as a Windows service; it provides the
boilerplate code for interacting with the service infrastructure on Windows. You define a
configuration for your application service in XML, then use WinSW, along with your configuration, as
a service controller.
The full specification for the service configuration can be found here:
https://github.com/winsw/winsw/blob/v3/samples/complete.xml
In this initial implementation, we provide support for most of the available elements, with the
exception of:
Support for workingdirectory and env will follow in subsequent commits; these fields can be added to
the generic
ServiceInstallCtx
since they are common options on all platforms.Most of the code here deals with building the configuration file. This code was written as a
separate function so that the different options could be unit tested. There is an integration/system
test in a similar fashion to the sc manager.
e1844e2 Extend
ServiceInstallCtx
with new optionsIt is very common to define a working directory for a service process and a list of environment
variables to pass to the process when it runs. The
ServiceInstallCtx
is extended for this becauseit applies to most service managers.
In this particular case, three of the managers have been extended to support the variables: Systemd,
Launchd and WinSW. The Windows
sc.exe
service manager does not support specifying either. Theother two unix-based service managers might, but I am not familiar with those at the present time.
It should be easy enough to extend them with a further PR.