Adrian Schmitt wrote: > Hi, > > i am writing a controller that does some admin stuff. I would really > love to add a "restart pylons" functionality. > > How would I do this? Is there something built in? > > As I am monitoring the pylons process with daemontools (or monit on > another machine and on a windows machine i hav written my own tool > that monitors it), it would be sufficient to just stop the process, as > the monitoring tool would then start a new instance.
The way the reloader does it is just os._exit(3) (the monitoring process looks for an exit code 3 to restart, and otherwise actually exits). os.exit() from threads didn't really work right, but os._exit() is rather... rude. It can leave stuff unfinalized. Probably os.kill(os.getpid(), signal.SIGTERM) would be better. Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
