Чтобы мягко перезапустить supervisord (без убивания процесса), набираем
sudo supervisorctl reread sudo supervisorctl update
sudo supervisorctl reread sudo supervisorctl update
def main(): application = tornado.web.Application([ (r"/", MainHandler), ]) # this line will setup default logging no matter if you use command options tornado.options.parse_command_line()
logging.info("starting torando web server") http_server = tornado.httpserver.HTTPServer(application) http_server.listen(8888) # hardcoded port tornado.ioloop.IOLoop.instance().start()
mneradkov@mneradkov-thinkpad:~/workspace/mysuperproject$ ./webapp.py [I 120315 16:33:28 mixins:28] [INFO] Directory [/home/mneradkov/workspace/mysuperproject] [I 120315 16:33:28 mixins:28] [INFO] Connected to MySQL [xx.xx.xx.xx:xxxx] [I 120315 16:33:28 mixins:28] [INFO] Connected to memcache [127.0.0.1:11211] [I 120315 16:33:28 mixins:28] [INFO][I 120315 16:33:28 mixins:28] [INFO] Server [My Super Server] version [X.Xalpha] binded to [127.0.0.1:11100] [I 120315 16:33:28 webapp:37] Starting I/O loop to serve requests...
# supervisorctl stop my_super_service
# find path_to_my_service -type f -name "*.pyc" -delete # supervisorctl start my_super_service
# supervisorctl api-test-data RUNNING pid 22443, uptime 1 day, 16:52:01 api-test-empty FATAL Exited too quickly (process log may have details) auth-service RUNNING pid 22444, uptime 1 day, 16:52:01
supervisor> start api-test-empty api-test-empty: started supervisor> status api-test-data RUNNING pid 22443, uptime 1 day, 16:52:29 api-test-empty RUNNING pid 27360, uptime 0:00:13 auth-service RUNNING pid 22444, uptime 1 day, 16:52:29 supervisor>