GithubHelp home page GithubHelp logo

taskmaster's Introduction

Rustmaster

Description

Project is a simple implementation of taskmaster in Rust. It is a daemon that runs and monitors other programs. It is a simple copy of supervisor. The project is done using Vagrant virtual machine to be able to run it with sudo on school's PC.

Menu

Run


Launch Virtual Machine

using Makefile

make vagrant

Run server

Daemonized server should be run with sudo

sudo make daemon

Debug server can be run without sudo:

make nodaemon

Alt text


Run client

make client

List of possible client commands:

  • help

Alt text

  • status - returns a list of programs with their statuses

Alt text

  • start - starts task by its name

Alt text

  • stop - stops task by its name

Alt text

  • restart - restarts task by its name

Alt text

  • config - returns a task configuration in json.

Alt text

  • tail can read last N lines of stdout and stderr of log files or stream them to the console

Alt text

  • shutdown - Shut the remote taskmasterd down
  • exit && quit - Closes the CLI
  • http - transfer logs via http
  • update - Reloads the configuration tracking changes

Alt text

  • maintail - tail daemon logs

Alt text

  • signal - send signal to task process

Alt text


Stop server

Stop daemonized server should be run with sudo

sudo make stop

Debug server can be stopped without sudo:

make stop

Clean

make clean

Config

Only cmd field is mandatory for config, for other they are default values

  • cmd:

    • Type: string
    • Default value: No default value
    • Description: The command to use to launch the program
  • num_procs:

    • Type: positive integer (not zero)
    • Default value: 1
    • Description: The number of processes to start and keep running
  • umask:

    • Type: positive integer
    • Default value: 0o022
    • Description: An umask to set before launching the program
  • working_dir:

    • Type: string
    • Default value: current dir
    • Description: A working directory to set before launching the program
  • auto_start:

    • Type: boolean
    • Default value: true
    • Description: Whether to start this program at launch or not
  • auto_restart:

    • Type: Autorestart enum
    • Default value: unexpected
    • Description: Specifies if taskmaster should automatically restart a process if it exits when it is in the RUNNING state.
    • Values: false, unexpected, or true
  • exit_codes:

    • Type: Vector of positive integers (maybe change to set in the future)
    • Default value: [0]
    • Description: Defines which return codes represent an "expected" exit status
  • start_retries:

    • Type: positive integer
    • Default value: 3
    • Description: How many times a restart should be attempted before aborting
  • start_time:

    • Type: positive integer
    • Default value: 1
    • Description: How long the program should be running after it’s started for it to be considered "successfully started"
  • stop_signal:

    • Type: Signal (e.g., integer or enum)
    • Default value: TERM
    • Description: Specifies which signal should be used to stop (i.e., exit gracefully) the program
  • stop_time:

    • Type: positive integer
    • Default value: 10
    • Description: How long to wait after a graceful stop before killing the program
  • stdout:

    • Type: string
    • Default value: None (need to decide, maybe /tmp/taskname.stdout)
    • Description: Options to discard the program’s standard output (stdout) or to redirect it to a file
  • stderr:

    • Type: string
    • Default value: None (need to decide, maybe /tmp/taskname.stderr)
    • Description: Options to discard the program’s standard error (stderr) or to redirect it to a file
  • env:

    • Type: Map of key-value pairs (String, String)
    • Default value: Empty
    • Description: Environment variables to set before launching the program

taskmaster's People

Contributors

haksell avatar obito-git avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

obito-git

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.