Skip to main content

It supplies a command line interface API to start/stop/restart a daemon.

Project description

k3daemonize

Action-CI Build Status Documentation Status Package

It supplies a command line interface API to start/stop/restart a daemon.

k3daemonize is a component of pykit3 project: a python3 toolkit set.

Help to create daemon process. It supplies a command line interface API to start/stop/restart a daemon.

daemonize identifies a daemon by the pid file. Thus two processes those are set up with the same pid file can not run at the same time.

Install

pip install k3daemonize

Synopsis

import time
import k3daemonize


def run():
    for i in range(100):
        print(i)
        time.sleep(1)


# python foo.py start
# python foo.py stop
# python foo.py restart

if __name__ == '__main__':
    # there is at most only one of several processes with the same pid path
    # that can run.
    k3daemonize.daemonize_cli(run, '/var/run/pid')

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k3daemonize-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

k3daemonize-0.1.0-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page