Skip to content

Script to run a process in a separate group so that upstart can't kill all its children

License

Notifications You must be signed in to change notification settings

Demoncode/upstart-shield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

upstart-shield

This is a quick script designed to run a command in a new process group, while keeping a connection to the parent, spawned (pun intended) out of necessity due to Upstart's behaviour of killing an entire process group, which plays havoc with Celery's monitoring of its worker processes and prevents clean shutdown of Celery masters.

If you run a command using upstart-shield and then send a TERM signal to the upstart-shield process, it will send a TERM to the process of the command it spawned (but not the process group). This allows things like celery to do their relevant clean exits.

Similarly if the command's main process terminates then upstart-shield will also terminate, allowing upstart to restart it (and therefore the app)

Installation:

Standard

pip install [email protected]:Demoncode/upstart-shield.git#egg=upstart-shield

Developing upstart-shield

  • git clone [email protected]:Demoncode/upstart-shield.git
  • workon my-dev-virtualenv
  • cd upstart-shield
  • python setup.py develop

Usage:

upstart-shield cmd arg1 arg2 ...

If you are using upstart, then don't use the expect fork or expect daemon options.

About

Script to run a process in a separate group so that upstart can't kill all its children

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages