Skip to main content

A command line interface for managing s6 services, using the s6 toolset

Project description

A command line interface for managing s6 services, using the s6 toolset

Dependencies:

  • Python 3.6+

  • Plumbum

  • s6

  • BusyBox or (lsof, psmisc, coreutils)

  • musl-utils or glibc

Optional Dependencies:

  • lnav or multitail

  • highlight or bat

Demo Video

Installation

From PyPI:

pip install essex
# activate bash completion:
complete -o dirnames -C _essex essex

From 64-bit musl binary release:

wget "https://github.com/AndydeCleyre/essex/releases/download/1.0.0/essex-1.0.0-x86_64.tar.xz" -O - | tar xJf - -C /usr/local/bin
# activate bash completion:
complete -o dirnames -C _essex essex

Usage

essex 1.0.0

Simply manage services

Usage:
    essex [SWITCHES] [SUBCOMMAND [SWITCHES]]

Meta-switches:
    -h, --help                                            Prints this help message and quits
    --help-all                                            Prints help messages of all sub-commands and quits
    -v, --version                                         Prints the program's version and quits

Switches:
    -d, --directory SERVICES_DIRECTORY:str                folder of services to manage; the default is the first existing match from ('./svcs', '~/svcs',
                                                          '/var/svcs', '/svcs'), unless a colon-delimited SERVICES_PATHS env var exists;
    -l, --logs-directory SERVICES_LOGS_DIRECTORY:str      folder of services' log files; the default is SERVICES_DIRECTORY/../svcs-logs

Sub-commands:
    cat                                                   View services' run, finish, and log commands
    disable                                               Configure individual services to be down, without actually stopping them
    enable                                                Configure individual services to be up, without actually starting them
    list                                                  List all known services
    log                                                   View a service's log
    new                                                   Create a new service
    off                                                   Stop all services and their supervision
    on                                                    Start supervising all services
    pt                                                    Print a sample Papertrail log_files.yml
    reload                                                Restart (all or specified) running services whose run scripts have changed
    sig                                                   Send a signal to a service
    start                                                 Start individual services
    status                                                View the current states of (all or specified) services
    stop                                                  Stop individual services
    sync                                                  Start or stop services to match their configuration
    tree                                                  View the process tree from the supervision root

Packaging

pip install -r requirements.txt
# Edit pyproject.toml as desired.
# Create a wheel and source distribution in dist/:
flit build
# Create a wheel and source distribution in dist/ AND upload to PyPI:
flit publish

One can build a single-file executable suitable for dropping into an Alpine-based container with s6 (no Python or Plumbum necessary), using Docker and pyinstaller-alpine.

From the inner essex folder:

docker run --rm -v "${PWD}:/src" inn0kenty/pyinstaller-alpine:3.7 -F --clean ./essex.py

It comes out to ~10MB. Alternatively, a build script using the same image, but Buildah rather than Docker, is included as mkbin.sh.

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

essex-1.0.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

essex-1.0.0-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file essex-1.0.0.tar.gz.

File metadata

  • Download URL: essex-1.0.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.21.0

File hashes

Hashes for essex-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9c6613536fd0528ab19642720287b1605192f76f940fd3524f7a2399ceba6b81
MD5 4b9b3eaeb4936c0aebfbeb1aa8b2a64b
BLAKE2b-256 60d29f739342b3b4509fcc7c0676240084b200394d56856a6fe64eb63800f44b

See more details on using hashes here.

File details

Details for the file essex-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: essex-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.21.0

File hashes

Hashes for essex-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1defec2dae2528abfb19d14390c178b4450d3cacae2a2e1c36e87e0bb82816d8
MD5 69006cfb0f2693eaa22f8f64cf533941
BLAKE2b-256 3f4151ed8e09edcdadcb86d9ffb5e31fcc7b3ec988183b1cd8df219453cc46c5

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