使用s6工具集创建和管理s6服务的命令行界面

essex的Python项目详细描述


使用s6工具集创建和管理s6服务的命令行界面

依赖关系:

  • Python 3.6+
  • Plumbum
  • s6
  • BusyBox or (lsof, psmisc, coreutils)
  • musl-utils or glibc

可选依赖项:

  • lnav or multitail
  • highlight or bat

Demo Video

安装

来自PYPI:

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

从64位MUSL二进制版本开始:

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

用法

essex 2.0.2

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:path                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:path      folder of services' log files; the default is SERVICES_DIRECTORY/../svcs-logs

Sub-commands:
    cat                                                    View (all or specified) services' run, finish, and log commands; Alias for print
    disable                                                Configure (all or specified) services to be down, without actually stopping them
    enable                                                 Configure (all or specified) services to be up, without actually starting them
    list                                                   List all known services
    log                                                    View (all or specified) services' current log files
    new                                                    Create a new service
    off                                                    Stop all services and their supervision
    on                                                     Start supervising all services
    pid                                                    Print the PIDs of running services, or s6-svscan (supervision root) if none specified
    print                                                  View (all or specified) services' run, finish, and log commands
    pt                                                     Print a sample Papertrail log_files.yml
    reload                                                 Restart (all or specified) running services whose run scripts have changed; Depends on
                                                           the runfile generating an adjacent run.md5 file, like essex-generated runfiles do; Alias
                                                           for upgrade; Deprecated
    sig                                                    Send a signal to (all or specified) services
    start                                                  Start (all or specified) services
    status                                                 View the current states of (all or specified) services
    stop                                                   Stop (all or specified) services
    sync                                                   Start or stop services to match their configuration
    tree                                                   View the process tree from the supervision root
    upgrade                                                Restart (all or specified) running services whose run scripts have changed; Depends on
                                                           the runfile generating an adjacent run.md5 file, like essex-generated runfiles do

包装

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

可以构建一个适合放入基于alpine的容器的单个文件可执行文件 使用s6(不需要python或plumbum),使用docker和pyinstaller-alpine

从内部文件夹:

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

它的输出约为10MB。或者,使用相同映像的生成脚本, 但Buildah而不是Docker包含在mkbin.sh中。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java编辑并重新运行spring引导单元测试,无需重新加载上下文即可加快测试速度   为什么我不能做演员?   java为什么是线程。join通常用于停止安卓中的线程   java从weblogic服务器调用JSON POST REST服务时收到400:错误请求   java在DeviceAdmin模式禁用时设置身份验证?   java SortedMap的keySet()能否始终安全地强制转换到SortedSet?   安卓 java。lang.NoSuchMethodException可包裹类   java JOGL库安装   javatomcat内存管理   java使用getString()中的变量   java将最小星号设置为评级栏   Java中字符串相等的println()方法。。。它到底是如何工作的?   java如何从文本中输出的数组中放入随机图像