Skip to content

Mono does not emit ProcessExit event on SIGTERM. #81093

@tmds

Description

@tmds

To reproduce:

dotnet new web -o web
cd web
dotnet run

Find the pid of the dotnet run process, and send it SIGTERM from another terminal:

kill -SIGTERM <pid>

With CoreCLR, the application shuts down, and the exit code is 0:

...
info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
$ echo $?
0

With Mono, the application keeps running, the dotnet run process gets terminated:

Terminated
$ echo $?
143

The web process is still running, you can send it SIGTERM seperately and it terminates nicely.

info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...

This difference in behavior is causing one of the source-build smoke tests to fail: dotnet/source-build#3174.

cc @akoeplinger

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-VM-meta-monoin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions