Giter VIP home page Giter VIP logo

eggsecutor's Introduction

🍳eggsecutor 🥚

A friendly file based stateful daemon tracker.

Table of contents

Installation

  • Install from crates.io

    • cargo install eggsecutor
  • Build manually from source

    $ git clone https://github.com/astherath/eggsecutor
    $ cd eggsecutor
    $ cargo install --path=.

Usage

eggsecutor works best when launching single-file binaries that are meant to run as background processes.

eggsecutor 1.0

astherath <[email protected]>

A friendly background process task manager

USAGE:
    eggsecutor [SUBCOMMAND]

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    clear    stops all of the processes being tracked and clears the tracking list
    hatch    start managing a binary process
    help     Print this message or the help of the given subcommand(s)
    list     list all managed processes
    stop     stop a process by name or pid

Common usage example

A simple example that should run as-is to showcase the main usage loop (flask and python3 required)

# create a simple flask server daemon in a file named "FLASK_SERVER"
cat << EOT >> FLASK_SERVER
#!/usr/bin/python3
from flask import Flask

app = Flask(__name__)

@app.route("/")
def index():
  return {"status": 200}

if __name__ == "__main__":
  app.run()
EOT

# make the file executable
chmod +x FLASK_SERVER

# start the process from an executable file
eggsecutor hatch FLASK_SERVER
> Hatching process "FLASK_SERVER" and starting to track...
> egg hatched, tracking process with pid: "3670"

# check the process is healthy
eggsecutor list
> Process name    pid     status
> -----------------------------------
> FLASK_SERVER    3670    Running

# once ready shut down the server by name (or pid)
# the following are equivalent
eggsecutor stop FLASK_SERVER
eggsecutor stop 3670
> stopping process with pid: 3670

# or, if you want to stop ALL running processes being tracked
eggsecutor clear

Customization

By design, eggsecutor is meant to be a low-maintenance (and therefore, low-option) tool.

The only user-defined variable is the location of the JSON state tracking file, which defaults to

~/.eggsecutor.state

If need be, this path can be overwritten by setting the EGGSECUTOR_STATE_FILE environment variable to a valid file path (if the path does not exist, it will be created upon first usage).

eggsecutor's People

Contributors

astherath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.