def do_foreground(self, arg): self.options.program[1:1] = ["-X", "debug-mode=on"] try: ZDCmd.do_foreground(self, arg) finally: self.options.program.remove("-X") self.options.program.remove("debug-mode=on")
def get_status(self): """This method only has side effects, despite its name: - Set "self.zd_pid" to the PID (0 if no PID found), based on the content of the PID file, e.g. "var/instance.pid". This value is checked by the startup machinery of Zope. - Set "self.zd_up" to 1 or 0 (unclear what this is used for) """ ZDCmd.get_status(self) # override value set by ZDCmd.get_status() # (always -1 or 0) self.zd_pid = self._get_pid_from_pidfile() if self.zd_pid > 0: self.zd_up = 1 else: self.zd_up = 0
def do_start(self, arg): # signal to Zope that it is being managed # (to indicate it's web-restartable) os.putenv('ZMANAGED', '1') ZDCmd.do_start(self, arg)