Skip to content

Commit

Permalink
Use PowerShell to set the new beats service to delayed start (#8720)
Browse files Browse the repository at this point in the history
Set the Windows service to use a delayed start. Use PowerShell to execute sc config, so we can set the service to delayed start.

Fixes #8711
  • Loading branch information
rwaight authored and andrewkroh committed Oct 24, 2018
1 parent 3ef0b4e commit 2198af0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,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*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

0 comments on commit 2198af0

Please sign in to comment.