-1

I started a flask app on an ubuntu server over ssh and the internet unfortunatly went down. The flask app however, kept running. Normally you would just press ctrl + C to end the app but I had to start a new window so I'm not at that screen.

I want to restart the app to use the new code changes that I pulled from a repository.

MarkusAfricanus
  • 113
  • 1
  • 16

1 Answers1

4

There are some options you may use:

  1. Casual way: find your flask app pid in ps aux and put it in command kill <pid>
  2. Better looking way: kill $(ps aux | grep '<your flask-app>' | awk '{print $2}') for datails, see an answer: Find and kill a process in one line using bash and regex

If you want to get previous state of the screen on server (to use ctrl-C). Try to use tmux. It saves screen state of your session despite on authenticated you or not. tmux new – generate new session. tmux attach – returning your previous session.

Vlad Rudskoy
  • 677
  • 3
  • 7
  • 24