From f43e3bb6aba6c059fc5da50f0227411dee6ec3f0 Mon Sep 17 00:00:00 2001 From: NextTurn <45985406+NextTurn@users.noreply.github.com> Date: Tue, 4 Feb 2020 00:00:00 +0800 Subject: [PATCH] Rename docs for SEO --- CONTRIBUTING.md | 2 +- README.md | 23 ++- WinSW.nuspec | 2 +- doc/exeConfigFile.md | 7 - doc/puppetWinSW.md | 149 ------------------ .../deferred-file-operations.md | 0 .../developer/project-structure.md | 8 +- docs/exe-config-file.md | 7 + {doc => docs}/extensions/extensions.md | 6 +- .../extensions/runaway-process-killer.md | 2 +- .../extensions/shared-directory-mapper.md | 2 +- {doc => docs}/installation.md | 4 +- .../logging-and-error-reporting.md | 0 {doc => docs}/selfRestartingService.md | 0 .../xml-config-file.md | 4 +- .../sample-complete.xml | 6 +- {examples => samples}/sample-minimal.xml | 4 +- .../winswTests/Configuration/ExamplesTest.cs | 4 +- .../Extensions/RunawayProcessKillerTest.cs | 2 +- src/winsw.sln | 4 +- 20 files changed, 43 insertions(+), 193 deletions(-) delete mode 100644 doc/exeConfigFile.md delete mode 100644 doc/puppetWinSW.md rename doc/deferredFileOperations.md => docs/deferred-file-operations.md (100%) rename doc/developer/projectStructure.md => docs/developer/project-structure.md (92%) create mode 100644 docs/exe-config-file.md rename {doc => docs}/extensions/extensions.md (82%) rename doc/extensions/runawayProcessKiller.md => docs/extensions/runaway-process-killer.md (97%) rename doc/extensions/sharedDirectoryMapper.md => docs/extensions/shared-directory-mapper.md (97%) rename {doc => docs}/installation.md (96%) rename doc/loggingAndErrorReporting.md => docs/logging-and-error-reporting.md (100%) rename {doc => docs}/selfRestartingService.md (100%) rename doc/xmlConfigFile.md => docs/xml-config-file.md (98%) rename examples/sample-allOptions.xml => samples/sample-complete.xml (97%) rename {examples => samples}/sample-minimal.xml (92%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 510817e..8e286e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,4 +29,4 @@ dotnet test src\Test\winswTests\winswTests.csproj ## Project Structure -You can find the project structure guideline [here](doc/developer/projectStructure.md). +You can find the project structure guideline [here](docs/developer/project-structure.md). diff --git a/README.md b/README.md index cd3558f..5b978db 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,15 @@ Alternative sources: * [Maven packaging](https://github.com/jenkinsci/winsw-maven-packaging) for executables, hosted by the [Jenkins project](https://jenkins.io/). Binaries are available [here](https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/). -* [Puppet](./doc/puppetWinSW.md), currently outdated (WinSW 1.x). Binaries are available on [Puppet Forge](https://forge.puppet.com/kenmaglio/winsw) ## Usage -WinSW is being managed by configuration files: [Main XML configuration file](doc/xmlConfigFile.md) and [EXE configuration file](doc/exeConfigFile.md). +WinSW is being managed by configuration files: [Main XML configuration file](docs/xml-config-file.md) and [EXE configuration file](docs/exe-config-file.md). Your renamed *WinSW.exe* binary also accepts the following commands: * `install` to install the service to Windows Service Controller. - This command requires some preliminary steps described in the [Installation guide](doc/installation.md). + This command requires some preliminary steps described in the [Installation guide](docs/installation.md). * `uninstall` to uninstall the service. The opposite operation of above. * `start` to start the service. The service must have already been installed. * `stop` to stop the service. @@ -56,17 +55,17 @@ Most commands require Administrator privileges to execute. Since v2.8, WinSW wil User documentation: -* [Installation guide](doc/installation.md) - Describes the installation process for different systems and .NET versions +* [Installation guide](docs/installation.md) - Describes the installation process for different systems and .NET versions * Configuration: - * [Main XML configuration file](doc/xmlConfigFile.md) - * [EXE configuration file](doc/exeConfigFile.md) - * [Logging and error reporting](doc/loggingAndErrorReporting.md) - * [Extensions](doc/extensions/extensions.md) + * [Main XML configuration file](docs/xml-config-file.md) + * [EXE configuration file](docs/exe-config-file.md) + * [Logging and error reporting](docs/logging-and-error-reporting.md) + * [Extensions](docs/extensions/extensions.md) * Use-cases: - * [Self-restarting services](doc/selfRestartingService.md) - * [Deferred file operations](doc/deferredFileOperations.md) + * [Self-restarting services](docs/self-restarting-service.md) + * [Deferred file operations](docs/deferred-file-operations.md) * Configuration Management: - * [Puppet Forge Module](doc/puppetWinSW.md) + * [Puppet Forge Module](docs/puppetWinSW.md) Developer documentation: @@ -76,7 +75,7 @@ Developer documentation: Contributions are welcome! No Contributor License Agreement is needed, just submit your pull requests. -See the [contributing guidelines](./CONTRIBUTING.md) for more information. +See the [contributing guidelines](CONTRIBUTING.md) for more information. ## License diff --git a/WinSW.nuspec b/WinSW.nuspec index 58f8450..e275b10 100644 --- a/WinSW.nuspec +++ b/WinSW.nuspec @@ -26,6 +26,6 @@ More info about the wrapper is available in the projects GitHub repository. - + diff --git a/doc/exeConfigFile.md b/doc/exeConfigFile.md deleted file mode 100644 index 40e42e5..0000000 --- a/doc/exeConfigFile.md +++ /dev/null @@ -1,7 +0,0 @@ -# EXE configuration file - -In addition to the [XML configuration file](xmlConfigFile.md), WinSW uses a standard .NET *WinSW.exe.config* file, which allows setting up some custom settings. - -Use-cases: -* Managing Logging levels of log4j -* etc. diff --git a/doc/puppetWinSW.md b/doc/puppetWinSW.md deleted file mode 100644 index 7aa2962..0000000 --- a/doc/puppetWinSW.md +++ /dev/null @@ -1,149 +0,0 @@ -## Puppet Module - -WinSW can be managed using Puppet. - -Please checkout the [Puppet Forge Page](http://forge.puppet.com/kenmaglio/winsw) for more information about specifics of this module. - -# winsw - -### Table of Contents - -1. [Important](#important) -1. [Description](#description) -1. [Setup - The basics of getting started with winsw](#setup) - * [Beginning with winsw](#beginning-with-winsw) -1. [Usage - Configuration options and additional functionality](#usage) - * [Additional Configurations](#additional-configuration-parameters) -1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) -1. [Limitations - OS compatibility, etc.](#limitations) -1. [Development - Guide for contributing to the module](#development) - -## Important - -If you change the $service_id value, after you have installed the service, and you do not ensure abscent first, you will cause errors. -The reason is because the code which tried to uninstall, will already have been effected. - -Tested on Windows 10 and Windows Server 2012 R2. -There shouldn't be any reason this wouldn't work on - -## Description - -This module encapsulates functionality of the WinSW service application wrapper. -The development of that project is accredited: [https://github.com/kohsuke/winsw](https://github.com/kohsuke/winsw) - -This module attempts to allow any executable with any arguments to be wrapped in a Windows Service. -This will require files to be placed on the system in a managed path: EXE, XML, EXE.Config - -### Derived Types: -* install -* service - -Install will create the folders in $install_path, drop the files in that folder named $serviceid[.exe|.xml]. -Then after those are successfull, the defined type will install the service into the Service Manager. - -Service will ensure the service is running. - -### Beginning with winsw - -By default, classifying a node with this class will not get you very far. -It will test that the module will work and will run an instance of powershell.exe as a service. - -You can take two approaches: - -1. Use the Defined Types under Usage in your own module. They will automatically be created once you add this module ot your puppet file. - 1. You can build your own class that manages multiple services this way, if you so choose. -1. You can classify a node with the winsw class, and use hiera to override the local variables. - -## Usage - -Usage Pattern for Installing and Configuring -Title = name of executable / service - -

-  winsw::install { 'MyService':
-    ensure                  => present,
-    service_name            => $service_name,
-    service_executable      => $service_executable,
-    service_argument_string => $service_argument_string,
-  } ->
-  winsw::service { 'MyService':
-    ensure => running,
-  }
-
- -Optional Parameters -

-    winsw_binary_version    => $winsw_binary_version,
-    install_path            => $install_path,
-    service_description     => $service_description,
-    service_env_variables   => $service_env_variables,
-    service_logmode         => $service_logmode,
-
- -Usage Pattern for Uninstalling -

-  winsw::install { 'MyService':
-    ensure => absent,
-  }
-
- -### Additional Configuration Parameters - - -To Specify Service Account to run service as -

-    service_user            => 'your_serviceaccount',
-    service_pass            => 'your_serviceaccount_password',
-    service_domain          => 'your_serviceaccount_domain'
-
- -To Run Interactively (not service account cannot be used - only local system) -

-    service_interactive     => $true
-
- -## Reference - -The module includes embedded the winsw executable file, and provides a template for the configuration XML. -It attepts to create whatever directories you need specified by $install_path -Then drops the needed files in that path as $service_name(.exe|.xml) - -Utilizing exec's against powershell this module will then manage the behavior flow of winsw commands. - -## Known Side-Effects - -On initial install, the output will show not only the Exec[install_serviceid], but also the Exec[rebuild_service_serviceid]. -This is expected as the config xml file is placed, which fires the notify on Exec[rebuild_service_serviceid]. -This notify is needed if a config xml file change happens. The service must be stopped, uninstalled, installed and started to take effect. - - -## Limitations - -Limitations for current release are really more around parameters which the native WinSW executable can take, which have not been implemented here yet. -Right now only the basics to get an executable running, with arguments and environment variables are possible. - -More will be added in later revisions. - -If you need one specifically please open an issue here on github, and I will try to add that functionality quickly for you. - -See: [https://github.com/kohsuke/winsw](https://github.com/kohsuke/winsw) - -## Development - -#### Please fork and submit pull requests - -To setup local environment: -

-puppet module install puppetlabs-powershell --version 2.1.0 --modulepath=[your path to modules here]
-puppet apply -v -e 'include winsw' --modulepath=[your path to modules here]
-
-You can include --noop if you don't want to apply, however service actions will fail as it won't actually install. - -If you run an elevated command prompt, you can navigate to the service executable directory. -Then you can use these to test states of your service and the module. (note MyService is your servie name) -

-MyService.exe stop
-MyService.exe uninstall
-MyService.exe start
-MyService.exe install
-
diff --git a/doc/deferredFileOperations.md b/docs/deferred-file-operations.md similarity index 100% rename from doc/deferredFileOperations.md rename to docs/deferred-file-operations.md diff --git a/doc/developer/projectStructure.md b/docs/developer/project-structure.md similarity index 92% rename from doc/developer/projectStructure.md rename to docs/developer/project-structure.md index 8b76a8f..58392a4 100644 --- a/doc/developer/projectStructure.md +++ b/docs/developer/project-structure.md @@ -3,9 +3,9 @@ :movie_camera: You can find the code dive session recorded video [here](https://youtu.be/_adhRj19ESY). ``` -|_ doc +|_ docs |_ eng -|_ examples +|_ samples |_ src |_ Core | |_ ServiceWrapper @@ -18,9 +18,9 @@ |_ Test/winswTest ``` -## :open_file_folder: examples +## :open_file_folder: samples -This folder contains templates for configuration files. *sample-minimal.xml* contains a template for mandatory configurations and *sample-allOptions.xml* contains all possible configurations with documentation. +This folder contains templates for configuration files. *sample-minimal.xml* contains a template for mandatory configurations and *sample-complete.xml* contains all possible configurations with documentation. ## :open_file_folder: Core diff --git a/docs/exe-config-file.md b/docs/exe-config-file.md new file mode 100644 index 0000000..065547f --- /dev/null +++ b/docs/exe-config-file.md @@ -0,0 +1,7 @@ +# EXE configuration file + +In addition to the [XML configuration file](xml-config-file.md), WinSW uses a standard .NET *WinSW.exe.config* file, which allows setting up some custom settings. + +Use-cases: +* Managing Logging levels of log4j +* etc. diff --git a/doc/extensions/extensions.md b/docs/extensions/extensions.md similarity index 82% rename from doc/extensions/extensions.md rename to docs/extensions/extensions.md index d1ad9f0..7f5a71c 100644 --- a/doc/extensions/extensions.md +++ b/docs/extensions/extensions.md @@ -5,8 +5,8 @@ These extensions allow to alter the behavior of the Windows service in order to ## Available extensions -* [Shared Directory Mapper](sharedDirectoryMapper.md) - Allows mapping shared drives before starting the executable -* [Runaway Process Killer](runawayProcessKiller.md) - Termination of processes started by the previous runs of WinSW +* [Shared Directory Mapper](shared-directory-mapper.md) - Allows mapping shared drives before starting the executable +* [Runaway Process Killer](runaway-process-killer.md) - Termination of processes started by the previous runs of WinSW ## Developer guide @@ -25,7 +25,7 @@ Generic extension creation guideline: * The extension should implement the configuration parsing from the `XmlNode`. * The extension should support disabling from the configuration file. -WinSW engine will automatically locate your extension using the class name in the [XML configuration file](../xmlConfigFile.md). +WinSW engine will automatically locate your extension using the class name in the [XML configuration file](../xml-config-file.md). See configuration samples provided for the extensions in the core. For extensions from external DLLs, the `className` field should also specify the assembly name. It can be done via fully qualified class name or just by the `${CLASS_NAME}, ${ASSEMBLY_NAME}` declaration. diff --git a/doc/extensions/runawayProcessKiller.md b/docs/extensions/runaway-process-killer.md similarity index 97% rename from doc/extensions/runawayProcessKiller.md rename to docs/extensions/runaway-process-killer.md index e2e6e57..780b426 100644 --- a/doc/extensions/runawayProcessKiller.md +++ b/docs/extensions/runaway-process-killer.md @@ -11,7 +11,7 @@ Since: WinSW 2.0. ## Usage -The extension can be configured via the [XML configuration file](../xmlConfigFile.md). Configuration sample: +The extension can be configured via the [XML configuration file](../xml-config-file.md). Configuration sample: ```xml diff --git a/doc/extensions/sharedDirectoryMapper.md b/docs/extensions/shared-directory-mapper.md similarity index 97% rename from doc/extensions/sharedDirectoryMapper.md rename to docs/extensions/shared-directory-mapper.md index d91f26b..927a7e0 100644 --- a/doc/extensions/sharedDirectoryMapper.md +++ b/docs/extensions/shared-directory-mapper.md @@ -9,7 +9,7 @@ Since: WinSW 2.0. ## Usage -The extension can be configured via the [XML configuration file](../xmlConfigFile.md). +The extension can be configured via the [XML configuration file](../xml-config-file.md). Configuration sample: ```xml diff --git a/doc/installation.md b/docs/installation.md similarity index 96% rename from doc/installation.md rename to docs/installation.md index 69234b1..f97f297 100644 --- a/doc/installation.md +++ b/docs/installation.md @@ -7,7 +7,7 @@ This page provides WinSW installation guidelines for different cases. In order to setup WinSW, you commonly need to perform the following steps: 1. Take *WinSW.exe* from the distribution, and rename it to your taste (such as *myapp.exe*) -1. Write *myapp.xml* (see the [XML config file specification](xmlConfigFile.md) for more details) +1. Write *myapp.xml* (see the [XML config file specification](xml-config-file.md) for more details) 1. Place those two files side by side, because that's how WinSW discovers its configuration. 1. Run `myapp.exe install ` in order to install the service wrapper. 1. Run `myapp.exe start` to start the service. @@ -33,7 +33,7 @@ The example below is a primitive example being used in the Jenkins project: ``` -The full specification of the configuration file is available [here](xmlConfigFile.md). +The full specification of the configuration file is available [here](xml-config-file.md). ### Step 3. Service registration diff --git a/doc/loggingAndErrorReporting.md b/docs/logging-and-error-reporting.md similarity index 100% rename from doc/loggingAndErrorReporting.md rename to docs/logging-and-error-reporting.md diff --git a/doc/selfRestartingService.md b/docs/selfRestartingService.md similarity index 100% rename from doc/selfRestartingService.md rename to docs/selfRestartingService.md diff --git a/doc/xmlConfigFile.md b/docs/xml-config-file.md similarity index 98% rename from doc/xmlConfigFile.md rename to docs/xml-config-file.md index ab09423..a49da75 100644 --- a/doc/xmlConfigFile.md +++ b/docs/xml-config-file.md @@ -2,7 +2,7 @@ This page describes the configuration file, which controls the behavior of the Windows service. -You can find configuration file samples in the [examples](../examples) directory of the source code repository. +You can find configuration file samples in the [samples](../samples) directory of the source code repository. Actual samples are being also published as a part of releases on GitHub and NuGet. ## File structure @@ -90,7 +90,7 @@ Multiple elements can be used to specify multiple dependencies. Optionally set a different logging directory with `` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`). -See the [Logging and error reporting](loggingAndErrorReporting.md) page for more info. +See the [Logging and error reporting](logging-and-error-reporting.md) page for more info. ### Arguments diff --git a/examples/sample-allOptions.xml b/samples/sample-complete.xml similarity index 97% rename from examples/sample-allOptions.xml rename to samples/sample-complete.xml index 7ffb4ff..eccbe9a 100644 --- a/examples/sample-allOptions.xml +++ b/samples/sample-complete.xml @@ -22,7 +22,7 @@ This configuration file should be placed near the WinSW executable, the name should be the same. E.g. for myapp.exe the configuration file name should be myapp.xml - You can find more information about configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md + You can find more information about configuration options here: https://github.com/winsw/winsw/blob/master/docs/xml-config-file.md --> @@ -230,7 +230,7 @@ SECTION:Logging Default mode: append Each mode has different settings. - See https://github.com/kohsuke/winsw/blob/master/doc/loggingAndErrorReporting.md for more details + See https://github.com/winsw/winsw/blob/master/docs/logging-and-error-reporting.md for more details --> diff --git a/src/Test/winswTests/Configuration/ExamplesTest.cs b/src/Test/winswTests/Configuration/ExamplesTest.cs index 8aa6dbc..fdc55aa 100644 --- a/src/Test/winswTests/Configuration/ExamplesTest.cs +++ b/src/Test/winswTests/Configuration/ExamplesTest.cs @@ -17,7 +17,7 @@ namespace winswTests.Configuration [Test] public void AllOptionsConfigShouldDeclareDefaults() { - ServiceDescriptor desc = Load("allOptions"); + ServiceDescriptor desc = Load("complete"); Assert.That(desc.Id, Is.EqualTo("myapp")); Assert.That(desc.Caption, Is.EqualTo("MyApp Service (powered by WinSW)")); @@ -54,7 +54,7 @@ namespace winswTests.Configuration Assert.That(directory, Is.Not.Null); } - string path = Path.Combine(directory, $@"examples\sample-{exampleName}.xml"); + string path = Path.Combine(directory, $@"samples\sample-{exampleName}.xml"); Assert.That(path, Does.Exist); XmlDocument dom = new XmlDocument(); diff --git a/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs b/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs index 92dcb54..003c78f 100644 --- a/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs +++ b/src/Test/winswTests/Extensions/RunawayProcessKillerTest.cs @@ -68,7 +68,7 @@ $@" Assert.Ignore(); var winswId = "myAppWithRunaway"; - var extensionId = "runawayProcessKiller"; + var extensionId = "runaway-process-killer"; var tmpDir = FilesystemTestHelper.CreateTmpDirectory(); // Spawn the test process diff --git a/src/winsw.sln b/src/winsw.sln index b4e6aa8..b78983a 100644 --- a/src/winsw.sln +++ b/src/winsw.sln @@ -20,8 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunawayProcessKiller", "Plu EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AA414F46-B863-473A-A0E0-C2971B3396AE}" ProjectSection(SolutionItems) = preProject - ..\examples\sample-allOptions.xml = ..\examples\sample-allOptions.xml - ..\examples\sample-minimal.xml = ..\examples\sample-minimal.xml + ..\samples\sample-complete.xml = ..\samples\sample-complete.xml + ..\samples\sample-minimal.xml = ..\samples\sample-minimal.xml EndProjectSection EndProject Global