Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay Start of Beats as Windows Service #8711

Closed
urso opened this issue Oct 23, 2018 · 2 comments
Closed

Delay Start of Beats as Windows Service #8711

urso opened this issue Oct 23, 2018 · 2 comments

Comments

@urso
Copy link

urso commented Oct 23, 2018

According to golang/go#23479 go based service can hang and time out on startup while Windows is Booting. The main Function might not even be executed in this time span.

Configuring delayed auto startup seems to resolve the issue. Setting the registry key HKLM\SYSTEM\CurrentControlSet\services\<service name>\DelayedAutostart to 1 will mark the process as delayed. Some Windows versions seem to support a per service delay setting via HKLM\SYSTEM\CurrentControlSet\services\<service name>\AutoStartDelay (DWORD in seconds).

When installing beats as services on Windows, we should enable Delayed Autostart and try to set the delay to 60s (default is 120s).

@andrewkroh
Copy link
Member

To implement this we need to add some PowerShell scripting to install-service.ps1 that sets the registry keys associated with the service. Then do some testing to make sure that it works across Windows versions.

@rwaight
Copy link
Contributor

rwaight commented Oct 23, 2018

Since we are using PowerShell to create a service, we can use PowerShell to set it to delayed start after creating the service. For filebeat, this would be something like:

$svcDelayed='config "{0}" start=delayed-auto' -f 'filebeat'
Start-Process -FilePath sc.exe -ArgumentList $svcDelayed

You could obviously pass whatever service when you declare $svcDelayed

Please let me know if you would like some help with this, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants