Skip to main content
Travis build status image Coverage status

succubus

Description

succubus is a lightweight python module for a fast and easy creation of python daemons and init scripts.

Examples

#!/usr/bin/env python

import logging
import sys
import time

from logging.handlers import WatchedFileHandler

from succubus import Daemon


class MyDaemon(Daemon):
    def run(self):
        """Overwrite the run function of the Daemon class"""
        while True:
            time.sleep(1)
            self.logger.warn('Hello world')

    def setup_logging(self):
        # TODO: don't log to /tmp except for example code
        handler = WatchedFileHandler('/tmp/succubus.log')
        self.logger = logging.getLogger('succubus')
        self.logger.addHandler(handler)


def main():
    daemon = MyDaemon(pid_file='succubus.pid')
    sys.exit(daemon.action())


if __name__ == '__main__':
    main()

Succubus implements the usual init script actions (start, stop, restart, status) in Python. So your init script can look like this:

#!/bin/bash
/usr/bin/my_succubus_daemon $1 --foo=42

If the init script is called as /etc/init.d/my_succubus_daemon start, this will translate into /usr/bin/my_succubus_daemon start --foo=42 being called. The start parameter is consumed by the succubus framework, i.e. when your code does the command line parsing, it looks as if /usr/bin/my_succubus_daemon --foo=42 was called. You can now parse the --foo=42 parameter as you please.

Metadata

Release files for succubus 1.0.post219

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for succubus 1.0.post219
File Size Uploaded Provenance Actions
succubus-1.0.post219.tar.gz 4.6 kB Without provenance Details for succubus-1.0.post219.tar.gz

Release files / succubus-1.0.post219.tar.gz

Download URL succubus-1.0.post219.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
72e34ed1e826c895939dfc271f4c72840b6012366d47ad0147a0252b6e45632f
BLAKE2b-256 checksum
How to use checksums
0a5bca644218403454b812a7cf8109cf0d0c8a201b2c03ed763df834f7910ab8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for succubus 1.0.post219

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.

Release history Release notifications | RSS feed

This release

1.0.post219 This release

1 release file No provenance

1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page