Skip to main content

Taskforce starts and restarts daemon processes. It will detect executable and/or module changes and automatically restart the affected processes.

Project description

This supports python 2.7 and python 3 on Unix derivatives. It has specific support for select.kqueue on MacOS and *BSD and the inotifyx bindings for Linux inotify. If neither of these facilities is available, taskforce operates in polling mode which adds some latency and processing overhead but is functionally the same.

Commands to be run are defined in a configuration file in YAML format. Let’s go straight to a quick example:

{
    "tasks": {
        "sshd": {
            "control": "wait",
            "commands": { "start": [ "/usr/sbin/sshd", "-D" ] }
        },
        "ntpd": {
            "control": "wait",
            "requires": "sshd",
            "defines": { "conf": "/etc/ntp.conf" },
            "commands": { "start": [ "/usr/sbin/ntpd", "-c", "{conf}", "-n"] },
            "events": [
                { "type": "self", "command": "stop" },
                { "type": "file_change", "path": "{conf}", "command": "stop" }
            ]
        }
    }
}

In this example, taskforce starts sshd and then starts ntpd. taskforce is set to wait on both programs and both programs are started so that they will not detach themselves. If either program exits, it will be restarted.

ntpd is run with a couple of extra features. First, it defines a tag for the configuration file name. This is convenient for when the element is used in multiple places. It also adds two events. The first fires if the executable file changes, and the second fires if the configuration file changes. The event type self is shorthand for the equivalent file_change event. In both cases, the event will cause the task to be stopped. As the task has the wait control, it will be immediately restarted.

Visit https://github.com/akfullfo/taskforce/ for more information.

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

taskforce-0.6.0.tar.gz (63.5 kB view details)

Uploaded Source

File details

Details for the file taskforce-0.6.0.tar.gz.

File metadata

  • Download URL: taskforce-0.6.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for taskforce-0.6.0.tar.gz
Algorithm Hash digest
SHA256 72a4ba6744983c082e098a8a5d2c016a33f16c470e6e351e5b41064157f5d13f
MD5 37211527a26df825a83d1167ca8ae66a
BLAKE2b-256 d223e874993bfd35e0b475f697d22c5328d57a3b88a03787483a0bed9502628b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page