This project has been archived by its maintainers, and is no longer receiving any updates.
==================
Lightweight and no-nonsense POSIX daemon library. Extensible, complete
with process forking and
`PID <http://en.wikipedia.org/wiki/Process_identifier>`__ management.
Inspired by `Sander
Marechal <http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/>`__.
License
-------
MIT/X11 - See
`LICENSE <https://github.com/stackd/daemon-py/blob/master/LICENSE>`__
Getting Started
---------------
**Installation**
::
# git clone https://github.com/flaviocpontes/daemonator.git
# cd daemon-py/
# python setup.py install
1. **Instantiation**
::
import daemon
class MyDaemon(daemon.Daemon):
"""Subclass Daemon-Python."""
...
def run(self):
"""Define what to daemonize by implementing the run() method."""
...
2. **Implementing control**
Finally, we want to be able to control our daemon.
::
...
if __name__ == "__main__":
daemon = MyDaemon('/tmp/mydaemon.pid') #Define a pidfile location (typically located in /tmp or /var/run)
if len(sys.argv) == 2:
if 'start' == sys.argv[1]:
daemon.start()
elif 'stop' == sys.argv[1]:
daemon.stop()
elif 'restart' == sys.argv[1]:
daemon.restart()
elif 'status' == sys.argv[1]:
daemon.status()
else:
sys.stdout.write("Unknown command\n")
sys.exit(2)
sys.exit(0)
else:
sys.stdout.write("Usage: %s start|stop|restart|status\n" % sys.argv[0])
sys.exit(2)
Metadata
Release files for daemonator 0.4.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| daemonator-0.4.1.1.tar.gz | 3.7 kB | Without provenance | Details |
Release files / daemonator-0.4.1.1.tar.gz
| Download URL | daemonator-0.4.1.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3a7f300fab3c7b533159df5b4b83e5cb24c41bf42af5ccc1251f67dd122738c
|
|
BLAKE2b-256 checksum How to use checksums |
c1541ad7ab172643948d875eb2e143b3e8c2493970777b8a4d30bd106e872e7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for daemonator 0.4.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.