Skip to content

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uinit

unix init — a small process manager written in Go, inspired by zinit.

uinit runs as a daemon that loads a list of processes from a YAML file and exposes them over a Unix socket. A CLI client talks to the daemon to inspect them.

This is a learning project for exploring Linux processes, signals, and Go systems programming.

Install

git clone https://github.com/mahmoud-emad/uinit.git
cd uinit
make build

Requires Go 1.26+. The binary is written to ./uinit.

Usage

Write a config file:

# processes.yaml
processes:
  - name: python-server
    cmd: python3 -m http.server
  - name: ping
    cmd: ping 8.8.8.8

Start the daemon:

./uinit init processes.yaml

In another terminal, list the processes:

./uinit list
PROCESS        STATUS     PID    UPTIME  COMMAND
python-server  ● running  45609  7s      python3 -m http.server
ping           ● running  45610  7s      ping 8.8.8.8
sleep-five     ○ exited   45611  5s      sleep 5

Inspect one of them, or read what it has written:

./uinit inspect ping
./uinit logs ping

Processes can also be stopped and started again while the daemon runs:

./uinit stop ping
./uinit start ping

The daemon keeps its state under /tmp/uinit: it listens on /tmp/uinit/uinit.sock, and each process writes its stdout and stderr to /tmp/uinit/logs/<name>.log.

Development

make lint   # gofmt, go vet, staticcheck, errcheck
make test   # go test -race ./...
make dist   # cross compile into dist/

CI runs the same three on every push and pull request. Tagging v* builds the binaries and publishes them to a GitHub release.

About

a small process manager written in Go, inspired by zinit https://github.com/threefoldtech/zinit

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages