16 +� 355Ä¿Æc+ 404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

-ˆÊÉ „h_È¿Æ)ö-# -*- coding: utf-8 -*- # daemon/runner.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # This is free software, and you are welcome to redistribute it under # certain conditions; see the end of this file for copyright # information, grant of license, and disclaimer of warranty. """ Daemon runner library. """ from __future__ import (absolute_import, unicode_literals) import errno import os import signal import sys import warnings import lockfile from . import pidfile from .daemon import ( _chain_exception_from_existing_exception_context, DaemonContext, basestring, unicode, ) try: # Python 3 standard library. ProcessLookupError except NameError: # No such class in Python 2. ProcessLookupError = NotImplemented __metaclass__ = type warnings.warn( "The ‘runner’ module is not a supported API for this library.", DeprecationWarning) class DaemonRunnerError(Exception): """ Abstract base class for errors from DaemonRunner. """ def __init__(self, *args, **kwargs): self._chain_from_context() super().__init__(*args, **kwargs) def _chain_from_context(self): _chain_exception_from_existing_exception_context(self, as_cause=True) class DaemonRunnerInvalidActionError(DaemonRunnerError, ValueError): """ Raised when specified action for DaemonRunner is invalid. """ def _chain_from_context(self): # This exception is normally not caused by another. _chain_exception_from_existing_exception_context(self, as_cause=False) class DaemonRunnerStartFailureError(DaemonRunnerError, RuntimeError): """ Raised when failure starting DaemonRunner. """ class DaemonRunnerStopFailureError(DaemonRunnerError, RuntimeError): """ Raised when failure stopping DaemonRunner. """ class DaemonRunner: """ Controller for a callable running in a separate background process. The first command-line argument is the action to take: * 'start': Become a daemon and call `app.run()`. * 'stop': Exit the daemon process specified in the PID file. * 'restart': Stop, then start. """ start_message = "started with pid {pid:d}" def __init__(self, app): """ Set up the parameters of a new runner. :param app: The application instance; see below. :return: ``None``. The `app` argument must have the following attributes: * `stdin_path`, `stdout_path`, `stderr_path`: Filesystem paths to open and replace the existing `sys.stdin`, `sys.stdout`, `sys.stderr`. * `pidfile_path`: Absolute filesystem path to a file that will be used as the PID file for the daemon. If ``None``, no PID file will be used. * `pidfile_timeout`: Used as the default acquisition timeout value supplied to the runner's PID lock file. * `run`: Callable that will be invoked when the daemon is started. """ self.parse_args() self.app = app self.daemon_context = DaemonContext() self._open_streams_from_app_stream_paths(app) self.pidfile = None if app.pidfile_path is not None: self.pidfile = make_pidlockfile( app.pidfile_path, app.pidfile_timeout) self.daemon_context.pidfile = self.pidfile def _open_streams_from_app_stream_paths(self, app): """ Open the `daemon_context` streams from the paths specified. :param app: The application instance. Open the `daemon_context` stan