diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e6d480de905..abcb2af47f7 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -304,6 +304,7 @@ The issue will be fixed in the 6.4.1 release. - Add module state reporting for Beats Monitoring. {pull}7075[7075] - Release the `rename` processor as GA. {pull}7656[7656] - Add support for Openstack Nova in `add_cloud_metadata` processor. {pull}7663[7663] +- Add support to set Beats services to automatic-delayed start on Windows. {pull}8720[8711] *Auditbeat* diff --git a/dev-tools/packaging/templates/windows/install-service.ps1.tmpl b/dev-tools/packaging/templates/windows/install-service.ps1.tmpl index c4b4f682f3c..4aecfc56cb8 100644 --- a/dev-tools/packaging/templates/windows/install-service.ps1.tmpl +++ b/dev-tools/packaging/templates/windows/install-service.ps1.tmpl @@ -12,3 +12,9 @@ $workdir = Split-Path $MyInvocation.MyCommand.Path New-Service -name {{.BeatName}} ` -displayName {{.BeatName | title}} ` -binaryPathName "`"$workdir\{{.BeatName}}.exe`" -c `"$workdir\{{.BeatName}}.yml`" -path.home `"$workdir`" -path.data `"C:\ProgramData\{{.BeatName}}`" -path.logs `"C:\ProgramData\{{.BeatName}}\logs`"" + +# Attempt to set the service to delayed start using sc config. +Try { + Start-Process -FilePath sc.exe -ArgumentList 'config {{.BeatName}} start=delayed-auto' +} +Catch { Write-Host "An error occured setting the service to delayed start." -ForegroundColor Red }