Skip to main content

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

Project description

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
pip install --user uc-daemon
and use
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:

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()))    

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

uc_daemon-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

uc_daemon-0.0.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file uc_daemon-0.0.1.tar.gz.

File metadata

  • Download URL: uc_daemon-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for uc_daemon-0.0.1.tar.gz
Algorithm Hash digest
SHA256 02e640bdf81e8eeb81b67e6340f81b1c9366cfe2816b99b5042abdf7f30f4a55
MD5 99f2df8a2cd48a03f1b47736ebb53b22
BLAKE2b-256 3a11ca446a1806bce17bff3de67b12655c880dd23868b465ad2881854c405e94

See more details on using hashes here.

File details

Details for the file uc_daemon-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: uc_daemon-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for uc_daemon-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae535ad00dba406612287e281ef7e32e1432cfb925a79f5488ac827fd27293ff
MD5 3a71aec677120e3242a0c322710a42b3
BLAKE2b-256 cbb7d2958d237dee8cf249117e8522cb6589e786c5a64a5ba8a97c40d435f5f0

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