Skip to content

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.
// 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.

// 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