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

now listening to Unix Signals to exit gracefully #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mkobaly
Copy link

@mkobaly mkobaly commented Jun 17, 2016

When running a mono application using docker the container and trying to stop the container it would take a while to exit and return with a non zero exit code.

LinuxConsoleRunHost is a copy of ConsoleRunHost from Topshelf with the UnixSignal support.
LinuxRunBuilder is copy of RunBuilder from Topshelf where the LinuxConsoleRunHost is used.

When running a mono application using docker the container and
trying to stop the container it would take a while to exit and
return with a non zero exit code.
@@ -28,6 +29,7 @@ public static void UseLinuxIfAvailable(this HostConfigurator configurator)
// Needed to overcome mono-service style arguments.
configurator.ApplyCommandLine(MonoHelper.GetUnparsedCommandLine());
configurator.UseEnvironmentBuilder((cfg) => new LinuxHostEnvironmentBuilder(cfg));
configurator.UseHostBuilder((environment, settings) => new LinuxRunBuilder(environment, settings));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, try to respect current spacing/tabs setup.

@mkobaly
Copy link
Author

mkobaly commented Jun 18, 2016

I will update the pull request.

@@ -28,6 +29,7 @@ public static void UseLinuxIfAvailable(this HostConfigurator configurator)
// Needed to overcome mono-service style arguments.
configurator.ApplyCommandLine(MonoHelper.GetUnparsedCommandLine());
configurator.UseEnvironmentBuilder((cfg) => new LinuxHostEnvironmentBuilder(cfg));
configurator.UseHostBuilder((environment, settings) => new LinuxRunBuilder(environment, settings));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I see, this will break those cases when the service is running under "mono-service" (as those are not intended to run under ConsoleRunHost.

AFAIK, you should modify LinuxHostEnvironment::CreateServiceHost(..) in order to instantiate a this new LinuxConsoleRunHost, instead of forcing a new builder to override the host everytime.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

2 participants