daemon.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:bitmask-dev 作者: leapcode 项目源码 文件源码
def is_process_started_by_init():
    """ Determine whether the current process is started by `init`.

        :return: ``True`` iff the parent process is `init`; otherwise
            ``False``.

        The `init` process is the one with process ID of 1.

        """
    result = False

    init_pid = 1
    if os.getppid() == init_pid:
        result = True

    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号