Taskmaster is a process manager written in rust
. It's a school project.
Taskmaster is a process control system based on Supervisord
It's a school project made to implement a unix process manager, with the following capabilites:
- Launch and monitor several Tasks
- Define tasks behaviour from a configuration file (See below)
- Reload the configuration and update the tasks accordingly
- Log the events
- A client/server architecture
The following configurations are expected for each task:
- Name of the task
- Command to run
- Number of process to spawn
- Startup launch behaviour
- Relaunch strategy:
- Always
- Never
- When an unexpected error occured
- Expected exit status
- How long the process must have been running to be considered successfull
- Number of tries a restart should be attempted before aborting
- Signal to exit gracefully
- Wait delay after a graceful stop (If the delay is exceded, a
SIGKILL
is sent) - IO redirections, stdout & stderr for the time beeing
- Environment variables
- Working directory
- Umask
The configuration is expected to be written in toml
[[task]]
name = "write bar" # name of the TASK
cmd = "echo bar" # the command to execute, shell-like
autostart = true # boolean, the TASK start with taskmaster
numprocess = 42 # uint, number to PROCESSES the TASK have to run
umask = 0777 # uint, set umask aka default permission on created file from process
workingdir = "/tmp" # working directory of the PROCESS
stdout = "/tmp/foo.out" # redirect STDOUT to <file>
stderr = "/tmp/foo.err" # redirect STDERR to <file>
stopsignal = "TERM" # signal to send to stop the running PROCESS
This project is fully written in Rust
To run this project, clone the repository and build it with Cargo
.
Term | Description |
---|---|
Task / Tasks | A task is refere to a configuration for running some processes |
Process / Processes | A process is a unix process |
IO | refere to stdin, stdout and stderr |