What would be the simplest way to daemonize a python script in Linux?

后端 未结 5 1954
既然无缘
既然无缘 2020-12-14 23:35

What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.

5条回答
  •  忘掉有多难
    2020-12-15 00:12

    Use grizzled.os.daemonize:

    $ easy_install grizzled
    
    >>> from grizzled.os import daemonize
    >>> daemon.daemonize()
    

    To understand how this works or to do it yourself, read the discussion on ActiveState.

提交回复
热议问题