Skip to content

Conversation

@nealef
Copy link
Contributor

@nealef nealef commented Mar 1, 2023

Provide fix for #81093 - "Mono does not emit ProcessExit event on SIGTERM"

* src/mono/mono/mini/mini-posix.c
  - Add signal handler for SIGTERM
  - SIGTERM handler will set a global variable that may be monitored by the GC finalizer thread

* src/mono/mono/metadata/gc.c
  - Monitor for sigterm and kick off the shutdown process when encountered by calling mono_runtime_try_shutdown().
  - Exit with either the user set exitcode (System.Environment.ExitCode) or SIGTERM + 128.

"Mono does not emit ProcessExit event on SIGTERM"

	* src/mono/mono/mini/mini-posix.c
	  - Add signal handler for SIGTERM
	  - SIGTERM handler will set a global variable that may be
	    monitored by the GC finalizer thread

	* src/mono/mono/metadata/gc.c
	  - Monitor for sigterm and kick off the shutdown process when
	    encountered by calling mono_runtime_try_shutdown().
	  - Exit with either the user set exitcode
	    (System.Environment.ExitCode) or SIGTERM + 128.
@ghost ghost added community-contribution Indicates that the PR has been added by a community member area-VM-meta-mono labels Mar 1, 2023
@nealef
Copy link
Contributor Author

nealef commented Mar 1, 2023

I assume I will need to add the same processing that's in mini-posix.c to mini-windows.c. I don't have that environment to test which is why I have hung off to see how the *IX builds went.

@nealef
Copy link
Contributor Author

nealef commented Mar 1, 2023

Closing so I can open a new PR that will provide a windows + posix solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-meta-mono community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant