GithubHelp home page GithubHelp logo

xiaobin0860 / supervisor-wildcards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aleszoulek/supervisor-wildcards

1.0 2.0 0.0 16 KB

Implemenents start/stop/restart commands with wildcard support for Supervisor

Python 100.00%

supervisor-wildcards's Introduction

Supervisor wildcards

Description

Adds mstop, mstart, mrestart and mstatus commands to Supervisor. Those commands works similar to stop, start, restart and status respectively, but they:

  • add support for process name wildcarding,
  • sends the start/stop/restart/status signal in parallel (which makes the batch commands finish faster).

In some usecases you can use groups support in Supervisor, but it doesn't allow you to have one process in multiple groups. That's when wildcarding can be really useful.

Example

supervisor> status
celery-a                                RUNNING    pid 15085, uptime 0:00:11
celery-b                                RUNNING    pid 15086, uptime 0:00:12
gunicorn-a                              RUNNING    pid 14151, uptime 0:05:18
gunicorn-b                              RUNNING    pid 14237, uptime 0:04:45
supervisor> mstop *-a
celery-a: stopped
gunicorn-a: stopped
supervisor> mstatus *-a
celery-a                                STOPPED    Nov 06 05:38 AM
gunicorn-a                              STOPPED    Nov 06 05:38 AM
supervisor>

Installation

pip install supervisor-wildcards

And then add into your supervisor.conf:

[ctlplugin:wildcards]
supervisor.ctl_factory = supervisorwildcards.controllerplugin:make_wildcards_controllerplugin

Configuration

[ctlplugin:wildcards]
supervisor.ctl_factory = supervisorwildcards.controllerplugin:make_wildcards_controllerplugin
match_group = 1

By default, supervisorwildcards plugin match the wildcards just against process name (not group). Setting match_group = 1 will try to match the pattern against "group_name:process_name" instead.

Changelog

  • 0.1.3
    • all parameter expands to *
    • Added match_group config option
  • 0.1.2
    • Fixed matching processes that are assigned to a group
  • 0.1.1
    • Commands are run in parallel (Thanks, Honza Kral)
  • 0.1.0
    • Simple support for mstop, mstart, mrestart

supervisor-wildcards's People

Contributors

aleszoulek avatar aliva avatar theduderog avatar honzakral avatar mnaberez avatar

Stargazers

Li Xiaobin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.