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

(DefaultGreengrass): Nucleus service does not stopped on Windows #208

Open
bgklika opened this issue Jun 29, 2023 · 1 comment
Open

(DefaultGreengrass): Nucleus service does not stopped on Windows #208

bgklika opened this issue Jun 29, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bgklika
Copy link
Contributor

bgklika commented Jun 29, 2023

Describe the bug
When we run scenarios on Windows we got the problem Nucleus service still running after scenario done.
When OTF start Nucleus on Windows Nucleus install and start yourself and a Windows service.
But when scenario is done OTF try to terminate Nucleus using taskkill command which can't stop Windows service.
With taskkill we have two problems: on Windows it warning with message:

Reason: This process can only be terminated forcefully (with /F option).

And even when taskkill get /F option and terminate Nucleus process it will be restarted soon as unexpectedly terminated Window service.

I think problem in DefaultGreengrass.stop() method which throw error logs like that:

DefaultGreengrass - Failed to kill Greengrass process 52968: ERROR: The process with PID 52968 could not be terminated.

I think stop() should be OS-specific and on Windows sill stop greengrass Windows service

Problem is no critical because when service is already started and OTF restart start it again old service stoppped and removed and new one has been installer and started.

Priority
Low. We have a lot of messages in logs about that but due to next startup of nuclues stops and reinstall Windows service it work over scenarios.

To Reproduce
Stop Greengrass service manually.
Run scenario.
When scenario finished check status of greengrass service. It is still running.

Expected behavior
When scenario done greengrass Windows service started by scenario should be stopped.

Actual behavior
When scenario done greengrass Windows service started by scenario still running

Environment

  • OS: confirmed for Windows 10 and Windows 11
  • JDK version: JDK11
  • Nucleus version: confirmed for 2.10.1-2.11.0

Additional context
None
.

@bgklika bgklika added the bug Something isn't working label Jun 29, 2023
@bgklika bgklika changed the title DefaultGreengrass: Nucleus service does not stopped on Windows (DefaultGreengrass): Nucleus service does not stopped on Windows Jun 30, 2023
@bgklika
Copy link
Contributor Author

bgklika commented Jul 11, 2023

public interface Commands has methods startNucleus() startGreengrassService() stopGreengrassService() but seems they incorrectly used on Windows to start and stop Nucleus service.
We been track all cases when Nucleus is started on Linux and Windows and move platform specific parts to platform package.

Currently looks like on Windows Nucleus started by cmd script during install phase but tried to stop just be killing Nucleus process which started as Windows system service.
Maybe part of Nucleus code related to stopping and removing Windows service should be copied from Nucleus to OTF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant