Revise docs for 3.0.0-alpha.8 (#768)

pull/808/head
Next Turn 2021-03-17 02:00:57 +08:00 committed by GitHub
parent 78bb7627fa
commit 3f6bc3195f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 40 deletions

View File

@ -114,7 +114,6 @@ Most commands require Administrator privileges to execute. WinSW will prompt for
* [XML configuration file](docs/xml-config-file.md)
* [Logging and error reporting](docs/logging-and-error-reporting.md)
* [Extensions](docs/extensions/extensions.md)
* [Shared Directory Mapper](docs/extensions/shared-directory-mapper.md)
* Use cases:
* [Self-restarting services](docs/self-restarting-service.md)
* [Deferred file operations](docs/deferred-file-operations.md)

View File

@ -1,38 +0,0 @@
# Shared Directory Mapper extension
By default Windows does not establish shared drive mapping for services even if it is configured in the Windows service profile.
And sometimes it is impossible to workaround it due to the domain policies.
This extension allows mapping external shared directories before starting up the executable.
Since: WinSW 2.0.
## Usage
The extension can be configured via the [XML configuration file](../xml-config-file.md).
Configuration sample:
```xml
<?xml version="1.0" encoding="utf-8" ?>
<service>
<id>sampleService</id>
<name>Sample service</name>
<description>This is a stub service.</description>
<executable>%BASE%\sleep.bat</executable>
<arguments></arguments>
<log mode="roll"></log>
<extensions>
<extension enabled="true" className="winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper" id="mapNetworDirs">
<mapping>
<map enabled="false" label="N:" uncpath="\\UNC"/>
<map enabled="false" label="M:" uncpath="\\UNC2"/>
</mapping>
</extension>
</extensions>
</service>
```
## Notes
* If the extension fails to map the drive, the startup fails

View File

@ -19,3 +19,5 @@ TODO
1. Replace `<delayedAutoStart />` with `<delayedAutoStart>true</delayedAutoStart>`.
1. Replace `<interactive />` with `<interactive>true</interactive>`.
1. Replace `<beeponshutdown />` with `<beeponshutdown>true</beeponshutdown>`.
1. Remove the `RunawayProcessKiller` extension.
1. Move `<mapping>.<map>` to `<service>.<sharedDirectoryMapping>.<map>`. Remove the `SharedDirectoryMapper` extension.

View File

@ -0,0 +1,7 @@
# Milestone management
[Milestones](https://github.com/winsw/winsw/milestones) are used to prioritize items.
- Place unplanned issues in `Future`.
- Place planned/WIP/done issues in `major.x`.
- When a new version is released, create a corresponding milestone `major.minor.patch` and move closed issues there.

View File

@ -42,27 +42,32 @@ The default working directory of the wrapper and it's child processes is the dir
### id
**Required**
Specifies the ID that Windows uses internally to identify the service.
This has to be unique among all the services installed in a system,
and it should consist entirely out of alpha-numeric characters.
### executable
**Required**
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.)
### name
**Optional**
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.
### description
**Optional**
Long human-readable description of the service.
This gets displayed in Windows service manager when the service is selected.
### startmode
**Optional**
This element specifies the start mode of the Windows service.
It can be one of the following values: Automatic, or Manual.
For more information, see the [ChangeStartMode method](https://docs.microsoft.com/windows/win32/cimwin32prov/changestartmode-method-in-class-win32-service).
@ -70,6 +75,7 @@ The default value is `Automatic`.
### delayedAutoStart
**Optional**
This Boolean option enables the delayed start mode if the `Automatic` start mode is defined.
For more information, see [Startup Processes and Delayed Automatic Start](https://techcommunity.microsoft.com/t5/ask-the-performance-team/ws2008-startup-processes-and-delayed-automatic-start/ba-p/372692).
@ -82,6 +88,7 @@ Windows service installation may fail in such case.
### depend
**Optional**
Specify IDs of other services that this service depends on.
When service `X` depends on service `Y`, `X` can only run if `Y` is running.
@ -94,12 +101,14 @@ Multiple elements can be used to specify multiple dependencies.
### logging
**Optional**
Optionally set a different logging directory with `<logpath>` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`).
See the [Logging and error reporting](logging-and-error-reporting.md) page for more info.
### Arguments
**Optional**
The `<arguments>` element specifies the arguments to be passed to the executable.
```xml
@ -118,6 +127,7 @@ The `<arguments>` element specifies the arguments to be passed to the executable
### stopargument/stopexecutable
**Optional**
~~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 the `<stoparguments>` element is present, winsw will instead launch another process of `<executable>` (or `<stopexecutable>` if that's specified) with the specified arguments, and expects that to initiate the graceful shutdown of the service process.
@ -446,6 +456,19 @@ Automatically refreshes the service properties when the service starts or the fo
- [start](cli-commands.md#start-command)
- [stop](cli-commands.md#stop-command)
- [restart](cli-commands.md#restart-command)
- [test](cli-commands.md#test-command)
The default value is `true`.
### `sharedDirectoryMapping`
By default Windows does not establish shared drive mapping for services even if it is configured in the Windows service profile.
And sometimes it is impossible to workaround it due to the domain policies.
This allows mapping external shared directories before starting up the executable.
```xml
<sharedDirectoryMapping>
<map label="N:" uncpath="\\UNC" />
<map label="M:" uncpath="\\UNC2" />
</sharedDirectoryMapping>
```