Skip to content

hortega/process-supervisor-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published