Stop an empty website

When you deploy a new version of an existing .net website. What is the first safe way to stop an old cache-launch application?

Here is an example of what I would like to write (Pseudo deployment script):

dotnet stop mysite/mysite.dll <---- this line here
mv mysite/ mysite.bak/
cp newly-published-mysite/ mysite/
dotnet run mysite/mysite.dll

killall dotnetIt seems a little unsafe. How will this work if I have two small sites on one box?

+4
source share
2 answers

I decided to use a dispatcher to monitor and control the process. Here is a great setup article .

It makes it easy to manage specific applications in dotnet, for example:

supervisorctl stop MyWebsiteName
supervisorctl start MyWebsiteName

, , , ... - .

+5

, Kestrel . PID dll :

kill $(ps aux | grep 'MySite.dll' | awk '{print $2}')

grep kill . Microsoft.Extensions.Internal.ProcessExtensions.KillTree ( ).

+6

Source: https://habr.com/ru/post/1674418/


All Articles