当前位置: 首页>>代码示例>>Python>>正文


Python signal.SIGTTIN属性代码示例

本文整理汇总了Python中signal.SIGTTIN属性的典型用法代码示例。如果您正苦于以下问题:Python signal.SIGTTIN属性的具体用法?Python signal.SIGTTIN怎么用?Python signal.SIGTTIN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在signal的用法示例。


在下文中一共展示了signal.SIGTTIN属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def __init__(self, name, pid_dir='/var/run', signals=None):
        """
        Constructor.

        ``name`` is a string that identifies the daemon. The name is
        used for the name of the daemon process, the PID file and for
        the messages to syslog.

        ``pid_dir`` is the directory in which the PID file is stored.

        ``signals`` list of operating signals, that should be available
        for use with :py:meth:`.send_signal`, :py:meth:`.got_signal`,
        :py:meth:`.wait_for_signal`, and :py:meth:`.check_signal`. Note
        that SIGTERM is always supported, and that SIGTTIN, SIGTTOU, and
        SIGTSTP are never supported.
        """
        self.name = name
        self.pid_file = _PIDFile(os.path.join(pid_dir, name + '.pid'))
        self._signal_events = {int(s): threading.Event()
                               for s in ((signals or []) + [signal.SIGTERM])}
        self.logger = logging.getLogger(name)
        if not self.logger.handlers:
            self.logger.addHandler(logging.NullHandler())
        self.files_preserve = [] 
开发者ID:torfsen,项目名称:service,代码行数:26,代码来源:__init__.py

示例2: make_default_signal_map

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def make_default_signal_map():
    """ Make the default signal map for this system.

        The signals available differ by system. The map will not
        contain any signals not defined on the running system.

        """
    name_map = {
        'SIGTSTP': None,
        'SIGTTIN': None,
        'SIGTTOU': None,
        'SIGTERM': 'terminate',
        }
    signal_map = dict(
        (getattr(signal, name), target)
        for (name, target) in name_map.items()
        if hasattr(signal, name))

    return signal_map 
开发者ID:blackye,项目名称:luscan-devel,代码行数:21,代码来源:daemon.py

示例3: make_default_signal_map

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def make_default_signal_map():
    """ Make the default signal map for this system.

        The signals available differ by system. The map will not
        contain any signals not defined on the running system.

        """
    name_map = {
        'SIGTSTP': None,
        'SIGTTIN': None,
        'SIGTTOU': None,
        'SIGTERM': 'terminate',
    }
    signal_map = dict(
        (getattr(signal, name), target)
        for (name, target) in name_map.items()
        if hasattr(signal, name))

    return signal_map 
开发者ID:candlepin,项目名称:virt-who,代码行数:21,代码来源:daemon.py

示例4: test_default_rewrites_can_be_overriden_with_setsid_enabled

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def test_default_rewrites_can_be_overriden_with_setsid_enabled():
    """In setsid mode, dumb-init should allow overwriting the default
    rewrites (but still suspend itself).
    """
    rewrite_map = {
        signal.SIGTTIN: signal.SIGTERM,
        signal.SIGTTOU: signal.SIGINT,
        signal.SIGTSTP: signal.SIGHUP,
    }
    with print_signals(_rewrite_map_to_args(rewrite_map)) as (proc, _):
        for send, expect_receive in rewrite_map.items():
            assert process_state(proc.pid) in ['running', 'sleeping']
            proc.send_signal(send)

            assert proc.stdout.readline() == '{}\n'.format(expect_receive).encode('ascii')
            os.waitpid(proc.pid, os.WUNTRACED)
            assert process_state(proc.pid) == 'stopped'

            proc.send_signal(signal.SIGCONT)
            assert proc.stdout.readline() == '{}\n'.format(signal.SIGCONT).encode('ascii')
            assert process_state(proc.pid) in ['running', 'sleeping'] 
开发者ID:Yelp,项目名称:dumb-init,代码行数:23,代码来源:proxies_signals_test.py

示例5: _spawn_new_workers

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def _spawn_new_workers(self, count: int) -> None:
        """
        Send signal to kill the worker.

        :param count: The number of workers to spawn
        """
        excess = 0
        for _ in range(count):
            # TTIN: Increment the number of processes by one
            self.gunicorn_master_proc.send_signal(signal.SIGTTIN)
            excess += 1
            self._wait_until_true(
                lambda: self.num_workers_expected + excess == self._get_num_workers_running(),
                timeout=self.master_timeout
            ) 
开发者ID:apache,项目名称:airflow,代码行数:17,代码来源:webserver_command.py

示例6: is_stop_signal

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def is_stop_signal(signum):
    return signum in (signal.SIGSTOP, signal.SIGTSTP,
                      signal.SIGTTIN, signal.SIGTTOU) 
开发者ID:pinterest,项目名称:ptracer,代码行数:5,代码来源:ptrace.py

示例7: handle_ttin

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def handle_ttin():
    handle_sig(signal.SIGTTIN, _start_backdoor_server) 
开发者ID:huskar-org,项目名称:huskar,代码行数:4,代码来源:signal.py

示例8: _handle_ttou

# 需要导入模块: import signal [as 别名]
# 或者: from signal import SIGTTIN [as 别名]
def _handle_ttou():
    handle_sig(signal.SIGTTIN, _stop_backdoor_server) 
开发者ID:huskar-org,项目名称:huskar,代码行数:4,代码来源:signal.py


注:本文中的signal.SIGTTIN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。