def run_as_daemon(f, *args, **kwargs):
    """Run the given function as a daemonized process.

    :param f: The function to run
    """
    try:
        import daemon
        with daemon.DaemonContext():
            f(*args, **kwargs)
    except ImportError:
        print(
            'You must be on a UNIX platform to use this feature and musthave installed `python-daemon`'
            )
