示例#1
0
 def stop(self):
   if self.state != RUNNING:
     raise Exception("Not running")
   self.state = READY
   supervisor.stop_service(self.name)
   supervisor.gen_conf()
   supervisor.reload()
   self.setup_nginx_config()
示例#2
0
 def start(self):
   if self.state != READY:
     raise Exception("Not ready")
   self.state = RUNNING
   supervisor.gen_conf()
   supervisor.reload()
   supervisor.start_service(self.name)
   self.setup_nginx_config()
示例#3
0
def cmd_boot():
  """Boot the system. Should only be called once after a reboot.
  """
  Base.metadata.create_all(engine)

  # TODO: setup/start postgresql
  supervisor.gen_conf()
  setup_nginx()

  for instance in all_instances():
    if instance.state == RUNNING:
      instance.state = READY
    instance.setup_nginx_config(reload=False)

  supervisor.start()