Metadata-Version: 2.1
Name: k3daemonize
Version: 0.1.0
Summary: It supplies a command line interface API to start/stop/restart a daemon.
Home-page: https://github.com/pykit3/k3daemonize
Author: Zhang Yanpo
Author-email: drdr.xp@gmail.com
License: MIT
Keywords: python,daemon
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.0
Description-Content-Type: text/markdown
Requires-Dist: k3ut (<0.2,>=0.1.15)
Requires-Dist: k3proc (<0.3.0,>=0.2.13)

# k3daemonize

[![Action-CI](https://github.com/pykit3/k3daemonize/actions/workflows/python-package.yml/badge.svg)](https://github.com/pykit3/k3daemonize/actions/workflows/python-package.yml)
[![Build Status](https://travis-ci.com/pykit3/k3daemonize.svg?branch=master)](https://travis-ci.com/pykit3/k3daemonize)
[![Documentation Status](https://readthedocs.org/projects/k3daemonize/badge/?version=stable)](https://k3daemonize.readthedocs.io/en/stable/?badge=stable)
[![Package](https://img.shields.io/pypi/pyversions/k3daemonize)](https://pypi.org/project/k3daemonize)

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

```python

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>


[pykit3]: https://github.com/pykit3

