0

Below is by code for spawing a fcgi script for nginx.

spawn-fcgi -d /home/ubuntu/workspace -f /home/ubuntu/workspace/index.py -a 127.0.0.1 -p 9001

Now, lets I want to make changes to the index.py script and reload with out bring down the system. How do reload the spawned program so the next connections are using the updated program while the others finish? For now I am killing the spawned process and running command again. I am hoping for something more graceful.

I tried this by the way.

sudo kill -1 `sudo lsof -t -i:9001
Tampa
  • 75,446
  • 119
  • 278
  • 425

1 Answers1

1

I have recently made something similar for node.js.

The idea is to have index.py as a very simple bootstrap script (which doesn‘t actually change much over time). It should catch SIGHUP, and reload/reread the application files (which are expected to change frequently).

Vlad GURDIGA
  • 1,284
  • 2
  • 14
  • 18