-
Notifications
You must be signed in to change notification settings - Fork 312
Have consistent way to terminate server across platforms #59
Comments
As a work-around, I created a shell script that behaves as a daemon and uses a fifo to cleanly shutdown the https://gist.github.com/chriseldredge/37d41925fdddecea8517 Tested on OS X but haven't tried wiring it into Docker. |
@chriseldredge awesome workaround! |
This will involve having a consistent way to handle |
It can be done using pure managed code if I am not wrong. |
Beta2 |
@chriseldredge your daemon works in Docker, though it requires the "ps" command be installed, which it may not be (e.g. it isn't in the Microsoft ASP.NET vNext Docker image - RUN apt-get install procps) |
This is finally done e19289f. We now rely on |
I was trying to run ASP.NET web servers inside Docker containers using “k web” command, I realized that Microsoft.AspNet.Hosting waits for console input to terminate web server. (see this line https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNet.Hosting/Program.cs#L90 )
This is preventing the process inside Docker container to terminate when no stdin is attached. (workaround: if I run the container with
-i
, it works fine since it attaches a stdin).I suggest removing this behavior, it doesn’t make sense to terminate upon stdin input, users always have Ctrl+C option to terminate and by convention, server applications are designed to be daemons and should not be interacting with STDIN.
The text was updated successfully, but these errors were encountered: