Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 1022 Bytes

Readme.md

File metadata and controls

23 lines (19 loc) · 1022 Bytes

Process supervisor

Daemon build in Rust that controls the state of different applications according to the configuration received via REST JSON commands.

How to run

  1. Clone the repository and cd into it.
  2. Run cargo run.
  3. Send PUT requests to http://localhost:8000/commands with the body in the next format:
{
  command: ["/path/to/executable", "argument1", "argument2"],
  cwd: "/path/to/workdir",
  state: "running"
}

state can be either running or stopped.

The supervisor will start a new process for any command in running state, or for a command in running state that was killed outside of the application. If a command state is changed from running to stopped, the process will be killed.

Possible improvements

  1. Better error handling. Right now errors starting or killing processes will result in panic.
  2. Refactor supervisor functionality outside of the main module.
  3. Write unit and integration tests for the application.