Skip to content

wegel/budom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

budom

budom is a per-user background daemon manager for Linux/Unix user processes.

Example terminal log:

$ budom run --name demo -- /bin/sh -lc 'while true; do echo hello; sleep 1; done'
3mZ7aK2pQ9xT

$ budom ps
ID            NAME  DESIRED  STATE    PID     RESTARTS  TAGS
3mZ7aK2pQ9xT  demo  Running  Running  482311  0         -

$ budom logs demo --tail 3
hello
hello
hello

$ budom stop demo

$ budom ps --all
ID            NAME  DESIRED  STATE   PID  RESTARTS  TAGS
3mZ7aK2pQ9xT  demo  Stopped  Exited  -    0         -

It provides:

  • run/list/inspect/start/stop/restart/remove lifecycle management
  • a per-user supervisor process (no systemd dependency)
  • reboot recovery with explicit budom recover command
  • restart policies with exponential backoff
  • raw stdout/stderr log capture and size-based rotation
  • stable job names and short/partial ID references
  • tag-based targeting for bulk stop/remove operations

Build

cargo build --release

Install locally:

install -m 755 target/release/budom ~/.local/bin/budom

Quick Start

Run a long-lived process:

budom run --name demo -- /bin/sh -lc 'while true; do echo hello; sleep 1; done'

List running jobs:

budom ps

Inspect details:

budom inspect demo --json

Read logs:

budom logs demo --tail 50

Recover desired-running services after reboot:

budom recover

Only recover when supervisor is down:

budom recover --if-supervisor-down

Interleave logs from all daemons matching tags (colorized per daemon):

budom logs --tag api --tag blue --tail 100 -f

Stop one or many jobs:

budom stop demo other-job 01abcde

Start one or many stopped jobs:

budom start demo other-job
budom start --tag api --tag blue

Restart one or many jobs:

budom restart demo other-job
budom restart --tag api --timeout 5s

Remove job state:

budom rm demo --force

Run with tags:

budom run --name api-a --tag api --tag blue -- /bin/sh -lc 'sleep 9999'

Filter by tags:

budom ps --tag api --tag blue

Stop/remove by tags:

budom stop --tag api --tag blue
budom rm tag:api --force

Replace an existing named daemon:

# Graceful replace: TERM, wait (default 10s), then KILL if needed
budom run --name api-a --replace --replace-timeout 15s -- /path/to/new-binary

# Force replace: immediate forced removal of old daemon
budom run --name api-a --replace --force -- /path/to/new-binary

ID and Ref Resolution

Commands that take a <ref> accept:

  1. exact name
  2. exact full ID (case-sensitive)
  3. unique ID prefix (including 1 character if unique)
  4. tag:<tag> selectors (for commands supporting multi-target refs, like stop/restart/rm)

If a prefix is ambiguous, the command fails with an ambiguity error.

Development

Checks used for CI/public quality:

cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test

License

MIT (see LICENSE).

About

A lightweight per-user daemon manager for running, supervising, and restarting background processes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages