A lightweight, zero-dependency bash solution for macOS (and Linux) to run any arbitrary shell command in the background, keep it running across terminal sessions, and easily stop or monitor it later.
This project serves as a clean, simple alternative to complex launchd XML configurations or rigid homebrew services when you just need to quickly daemonize a command using PID files.
- Start any command as a background service with a unique name
- Automatically manage PID files and logs in a user-specific directory
- Stop services gracefully with a configurable timeout before force-killing
- List all running services with their PIDs
- Check the status of services and tail their logs
- No automatic restarts e.g. on failure or system reboot
- No manual restarts (you have to call
backgrounded stop <name>followed bybackgrounded start <name <command>to restart) - No security features (services run with the same permissions as the user who started them)
- No dependency management
- No locking. If you hammer
backgrounded start <name>in parallel, it will start the process multiple imes and overwrite the PID file, leaving orphaned processes. Simply don't do that. - No log file handling beyond simple stdout/stderr redirection (no log rotation, compression, rchiving, etc.)
- No user permissions or system-level services (runs entirely in user space)
- No configuration files (all settings are via environment variables or command-line flags)
- No windows
- No linux (or at least not tested on linux, but could work in theory)
- No progress group handling. If the started process spawns child processes, they will not be tracked r managed by
backgroundede.g. not killed bystop. - No support for running multiple instances of the same service name (service names must be unique)
- No environment variable management (services inherit the environment of the shell that started them)
- No advanced logging features (logs are simple stdout/stderr redirection to a file)
- No resource monitoring (CPU, memory, etc.), limiting or alerting