4
0

windows_service.adoc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. = Windows Service install
  2. This option is to install OliveTin as a Windows service, which allows it to run in the background and start automatically when the system boots up. This is useful for servers or systems that need to run OliveTin without user intervention. If you want to run OliveTin as a regular application, you can follow the xref:install/windows.adoc[Windows install] instructions instead.
  3. == Download and extract;
  4. [NOTE]
  5. There is no .msi installer for OliveTin yet, so you will need to download the .zip file and extract it in the desired location.
  6. You can download the latest version of OliveTin here: link:https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin-windows-amd64.zip[`OliveTin-windows-amd64.zip`]
  7. * Create c:/Program Files/OliveTin/
  8. ** Copy **OliveTin.exe** into this directory.
  9. ** Copy the **webui** directory into this directory.
  10. * Create c:/ProgramData/OliveTin/
  11. ** Copy the **config.yaml** file into this directory.
  12. include::partial$install/windows_service_logs.adoc[]
  13. == Test OliveTin startup
  14. Open a command prompt and make suer you are in the c:/Program Files/OliveTin/ directory, then run:
  15. [shell]
  16. ----
  17. ./OliveTin.exe
  18. ----
  19. If everything is set up correctly, you should see the OliveTin service starting up and listening on port 1337.
  20. == Switch startup mode to a Windows service
  21. Windows services require executables to run a "service host" thread, which is not started by default for OliveTin on windows. To run OliveTin as a service, you will need to set this in your configuration file;
  22. include::partial$config-start.adoc[]
  23. ----
  24. serviceHostMode: "winsvc-standard"
  25. logLevel: info
  26. actions:
  27. ...
  28. ----
  29. == Register the service
  30. Open a command prompt as Administrator and run the following command;
  31. [WARN]
  32. Make sure to run `sc.exe` and not just `sc`, as the latter is a PowerShell alias for `Set-Content` and does not display any output, which can be very confusing.
  33. [shell]
  34. ----
  35. sc.exe create OliveTin binPath= "C:\Program Files\OliveTin\OliveTin.exe" start= auto
  36. ----
  37. == Start the service
  38. Start the service from the Microsoft Management Console (MMC) or by running the following command;
  39. [shell]
  40. ----
  41. sc.exe start OliveTin
  42. ----
  43. include::partial$install/post_generic.adoc[]