Skip to main content

Create daemon processes with CLI for start/stop/restart

Project description

k3daemonize

Action-CI 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.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k3daemonize-0.1.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file k3daemonize-0.1.3.tar.gz.

File metadata

  • Download URL: k3daemonize-0.1.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for k3daemonize-0.1.3.tar.gz
Algorithm Hash digest
SHA256 23356a20639001e56ffa1c7a5a104f0d8ef14f5accdae2f6ccf2129803e7fba2
MD5 9c0808f72de881bd7040515bb6522fd1
BLAKE2b-256 675fc83e165d024dce8030e476c11d2dbec5bec7c17157e6347b6daeccb5311a

See more details on using hashes here.

File details

Details for the file k3daemonize-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: k3daemonize-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for k3daemonize-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 15e00661d855567043723f11eeeca9f49efb9c5f75a1a15d87387a98e61e47ee
MD5 5d8741884c4a55fb2966dd5d753d74e0
BLAKE2b-256 52333f0e7fc0b31cdf41278a377e8e1481313e3605d410d1ce4795dead7b37f7

See more details on using hashes here.

Supported by

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