Superviseur - A simple process supervisor for UNIX-like systems

Overview

Superviseur

License: MPL-2.0 release

A simple process supervisor for UNIX-like systems. Currently only supports running executables, but I plan to add support for managing wasm and docker containers in the future.

Project Status: ๐Ÿฒ Unstable, alpha-ish quality.

๐Ÿšš Installation

# Install dependencies
brew install protobuf # macOS
sudo apt-get install -y protobuf-compiler # Ubuntu/Debian
curl -fsSL https://bun.sh/install | bash
# Compile
git clone https://github.com/tsirysndr/superviseur
cd superviseur/webui && bun install && bun run build && cd ..
cargo install --path .

macOS/Linux

brew install tsirysndr/tap/superviseur

Or download the latest release for your platform here.

๐Ÿ“ฆ Downloads

๐Ÿš€ Usage

USAGE:
    superviseur [SUBCOMMAND]

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

SUBCOMMANDS:
    build      Build all services or a specific one
    config     Get the config of a service
    down       Stop all services
    help       Print this message or the help of the given subcommand(s)
    init       Initialize the superviseur config
    list       List all services [aliases: ls]
    log        Get the log of a process
    new        Create a new service config
    ps         List all running processes
    restart    Restart all services or a specific one
    serve      Start the superviseur server
    start      Start all services or a specific one
    status     Get the status of a service
    stop       Stop all services or a specific one
    tail       Tail the log of a process
    ui         Start the superviseur ui
    up         Start all services

๐Ÿ“š Getting Started

Start the server

Superviseur uses a server-client architecture. The server is responsible for managing the processes, while the client is responsible for communicating with the server.

superviseur daemon

Initialize a new project

superviseur new

Start by initializing a new project. This will create a Superfile.hcl file in the current directory with the following contents:

project = "demo"
services = [
  {
    "name" = "demo"
    "type" = "exec"
    "command" = "ping $GITHUB_DOMAIN"
    "working_dir" = "/tmp"
    "description" = "Ping Service Example"
    "depends_on" = []
    "env" = {
      "GITHUB_DOMAIN" = "github.com"
    }
    "autostart" = true
    "autorestart" = false
    "namespace" = "demo_namespace"
    "port" = 5060
    "stdout" = "/tmp/demo-stdout.log"
    "stderr" = "/tmp/demo-stderr.log"
  }
]

Start the service

superviseur start demo

Start the service by running the start command.

Check the status

superviseur status demo

Output:

โ— demo - Ping Service Example
        Active: Running since 2023-03-05 19:17:56.512455 UTC; 17 seconds ago
           PID: 30887
       Command: ping $GITHUB_DOMAIN
     Directory: /tmp
           Log: /tmp/demo-stdout.log
        Stderr: /tmp/demo-stderr.log
   AutoRestart: false
          Type: exec
          Envs: GITHUB_DOMAIN=github.com

Show running processes

superviseur ps

Output:

 NAME   PID     STATUS             COMMAND               TYPE 
 demo   31200   Up 4 seconds ago   ping $GITHUB_DOMAIN   exec 

Stop the service

superviseur stop demo

Show all services

superviseur ls

Output:

 NAME   STATUS    COMMAND                 TYPE 
 demo   STOPPED   "ping $GITHUB_DOMAIN"   exec 

As a Github Action

You can use the setup-superviseur Github Action like so:

- uses: tsirysndr/setup-superviseur@v1
  with:
    version: 'v0.1.0-alpha.5'
- run: superviseur --help

๐Ÿ“– Examples

See the examples directory for more examples.

๐Ÿ“ License

MPL

You might also like...
fcp is a significantly faster alternative to the classic Unix cp(1) command
fcp is a significantly faster alternative to the classic Unix cp(1) command

A significantly faster alternative to the classic Unix cp(1) command, copying large files and directories in a fraction of the time.

A tool for automating terminal applications in Unix.

expectrl A tool for automating terminal applications in Unix. Using the library you can: Spawn process Control process Expect/Verify responces It was

A small unix and windows lib to search for executables in PATH folders.

A small unix and windows lib to search for executables in path folders.

Modern file system navigation tool on Unix
Modern file system navigation tool on Unix

monat -- Modern file system Navigator ็ฎ€ไฝ“ไธญๆ–‡ Introduction monat is a Unix shell auxiliary command focusing on the navigation of the file system, especia

A Unix shell written and implemented in rust ๐Ÿฆ€

vsh A Blazingly fast shell made in Rust ๐Ÿฆ€ Installation Copy and paste the following command and choose the appropriate installtion method for you. Yo

FreeDesktop-compliant trasher for Unix

to-trash ๐Ÿšฎ to-trash (tt for short) is a fast, small, and hopefully FreeDesktop-compliant file trasher for Linux. Compliance tt aims to have complianc

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement, but as a companion utility with some more user-friendly feedback and some optimisations that make sense under certain tasks (see below).

Just a UNIX's cat copy, but less bloated and in Rust.
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.
skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.

Please note: skyWM is currently in heavy development and is not usable as of yet. Documentation and versions will change quickly. skyWM skyWM is an ex

Releases(v0.1.0-alpha.5)
Owner
Tsiry Sandratraina
Software Engineer, enjoy using Go/Rust/Elixir and always keen to learn new things. I love to simplify and create user-friendly tools. 9CE9 3A9A 43D8 ED4A
Tsiry Sandratraina
A Rust on-site channel benchmarking helper. Inter-Process (async / busy) & Intra-Process (async single threaded / async multi threaded)

On-Site Rust Channel Benchmarking Helper Deploy on server to determine which public crates are the fastest for communicating in different architecture

null 23 Jul 9, 2024
Safe Unix shell-like parameter expansion/variable substitution via cross-platform CLI or Rust API

Safe Unix shell-like parameter expansion/variable substitution for those who need a more powerful alternative to envsubst but don't want to resort to

Isak Wertwein 4 Oct 4, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

HashMismatch 47 Nov 25, 2022
rpsc is a *nix command line tool to quickly search for file systems items matching varied criterions like permissions, extended attributes and much more.

rpsc rpsc is a *nix command line tool to quickly search for file systems items matching varied criterions like permissions, extended attributes and mu

null 3 Dec 15, 2022
A simple code that will load a shellcode directly into RAM memory in a new process

ใ€Œ ?? ใ€About RustSCLoader RustSCLoader is a simple code that has the intention of loading a shellcode directly into RAM memory in a new process that wi

null 5 May 15, 2023
A flexible simple theme manager for *nix systems

tema A theme manager for *nix systems respecting the FHS spec configuration As of now all the configuration is done via $XDG_CONFIG_HOME/tema/config.y

lb06 2 Sep 23, 2022
F-Fetch targets low systems. Written in Rust. It's very simple, designed so you can pick it up and replace it.

F-Fetch F-Fetch targets low systems. Written in Rust. It's very simple, designed so you can pick it up and replace it. First Look ~/.config/ffetch/con

cd 3 Jul 10, 2023
A Rust curses library, supports Unix platforms and Windows

pancurses pancurses is a curses library for Rust that supports both Linux and Windows by abstracting away the backend that it uses (ncurses-rs and pdc

Ilkka Halila 360 Jan 7, 2023
Reviving the Research Edition Unix speak command

This repository contains the source code of Unix speak program that appeared in the Third (1973) to Sixth (1975) Research Unix editions, slightly adjusted to run on a modern computer. Details on the code's provenance and the methods employed for reviving it can be found in this blog post.

Diomidis Spinellis 31 Jul 27, 2022
Spawn multiple concurrent unix terminals in Discord

Using this bot can be exceedingly dangerous since you're basically granting people direct access to your shell.

Simon Larsson 11 Jun 1, 2021