dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.07k stars 4.69k forks source link

The .NET 8 executable behaves differently from the .NET 6 executable on Linux. #106306

Open zhh0000zhh opened 1 month ago

zhh0000zhh commented 1 month ago

I'm using AlmaLinux 8 as my production environment and pm2 as my process manager. With .NET 6, I could directly overwrite the executable file using WinSCP. However, when using .NET 8, this operation results in an error. I suspect that the way .NET 6 and .NET 8 handle executable files on Linux is different. Are there any ways to confirm this behavior and reduce the cost of program updates? thanks

am11 commented 1 month ago

this operation results in an error

What does the error message say? There is not much information for us to go on.

zhh0000zhh commented 1 month ago

this operation results in an error

What does the error message say? There is not much information for us to go on.

General error (the server should provide an error description). Error code: 4 Error message returned by the server: Failure

am11 commented 1 month ago

Is the process still running when you execute the scp command? If so, can you stop the process and then run the scp to see if it succeeds? If both answers are yes, then it could be about the flock advisory being effective with either -o mand (mandatory) filesystem mount or chmod g-x (turn off group execution) and g+s (turn on group ID).

zhh0000zhh commented 1 month ago

Is the process still running when you execute the scp command? If so, can you stop the process and then run the scp to see if it succeeds? If both answers are yes, then it could be about the flock advisory being effective with either -o mand (mandatory) filesystem mount or chmod g-x (turn off group execution) and g+s (turn on group ID).

The current issue is that I was able to update the executable file of a running process (using .NET 6) using the same method, but after upgrading to .NET 8, I am unable to do so even though nothing else has changed. I usually restart the program after replacing the file to minimize downtime.

jeffhandley commented 1 month ago

Perhaps something for @dotnet/appmodel to look at?

agocke commented 2 weeks ago

Could you provide more details on exactly how you're deploying the application? Is this a framework-dependent app? Are you deploying it with an apphost (the native executable)? Are you copying each assembly over individually?

zhh0000zhh commented 2 weeks ago

Could you provide more details on exactly how you're deploying the application? Is this a framework-dependent app? Are you deploying it with an apphost (the native executable)? Are you copying each assembly over individually? Deployment is standalone, target environment linux-x64 image This is the directory tree on the server, the server is almalinux 8.10