runtime: [.NET8 + ARM64] Build no longer responds to SIGTERM and gets the Ubuntu service manager in trouble

Description

I’m building my ARM64 binary by either of both commands below (the reported issue exists on both builds):

dotnet publish -c Release -r linux-arm64 -p:PublishSingleFile=true -p:SelfContained=true -p:UseNativeAOTCompiler=true MyProject.csproj
dotnet publish -c Release -r linux-arm64 -p:PublishSingleFile=true -p:SelfContained=true -p:PublishReadyToRun=true MyProject.csproj

The .NET 7 binary responds well to the Ubuntu service manager command for stopping the server

service MyService stop

With .NET 8 this no longer works well: the Ubuntu service manager sends out SIGTERM, which is not respected by the .NET 8 binary but keeps the service running. This triggers a timeout logic on the Ubuntu service manager and makes it sending out SIGKILL to finally kill the service. Obviously not the preferred handling…

How could the .NET 7 signal handling be restored?

Reproduction Steps

Please see above

Expected behavior

.NET8 build should work as .NET 7 build

Actual behavior

.NET8 build does not work as .NET 7 build

Regression?

yes

Known Workarounds

none

Configuration

No response

Other information

No response

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 39 (20 by maintainers)

Most upvoted comments

@tommcdon curious: I wonder why the tools would not be provided as ‘self-contained’ binaries to make their usage easy as possible?

Our end goal is to ship them as Native AOT binaries. We have an item on our backlog to do this work and hope to get to it in the .NET 9 timeframe.