Metadata-Version: 2.1
Name: uc-daemon
Version: 0.0.1
Summary: A set of classes and functions for demonizing a process and related tools..
Home-page: https://github.com/dentist128/uc_daemon
Author: Eduard S. Markelov
Author-email: markeloveduard@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Requires-Python: >=2.6, <4
Description-Content-Type: text/markdown

# uc_daemon  
A set of classes and functions for demonizing a process and related tools.  

It is part of the Unicon project.

https://unicon.10k.me

## Usage:

##### Install
```sh
pip install --user uc-daemon
```
##### and use

```python
import uc_daemon
```

## Functions:

**daemonize()**

Become a daemon.
To base process returns daemonized process id on successful and less than zero on fails.
To daemonized process returns zero.

**redirectio(handle)**

Redirects standart descriptors to specified file handle.

## Global constants

**LOGGER**

You may override this constant to manage debugging messages.

## Example:

```python
import os
import sys
import uc_daemon

pid = uc_daemon.daemonize()

if (pid == 0):
    print("I'm daemon! My pid is %d" % os.getpid())
else:
    print("Daemon started with pid %d and my pid is %d" % (pid, os.getpid()))    
```


