def daemonize(callback, run_interval, **kwargs):
    if flags.OPTIONS.daemonize:
        with daemon.DaemonContext(**kwargs):
            logging.info('run as daemon')
            _daemon(callback, run_interval)
    else:
        _daemon(callback, run_interval)
daemonize callback and run every run_interval seconds.
dataset/ETHPy150Open openstack/compass-core/compass/utils/daemonize.py/daemonize