jstatus is a lightweight shell utility that provides an at-a-glance overview of all Bastille jails and their enabled services on a FreeBSD host.
It automatically discovers jails and services without requiring configuration.
Key Features
- Automatic discovery: Detects all Bastille jails and enabled services dynamically.
- Zero dependencies: Written in POSIX
sh; requires only FreeBSD base utilities and Bastille. - Service monitoring: Checks whether enabled daemon services are running.
- Color-coded status: Quickly identifies healthy, partially failed, and stopped jails.
- Script integration: Returns exit code
0for healthy systems and1when failures are detected. - Flexible filtering: Monitor all jails or select specific ones.
Status Indicators
| Status | Meaning |
|---|---|
| UP | Jail running; all monitored services healthy. |
| WARN | Jail running; one or more services failed. |
| DOWN | Jail stopped despite being configured to start. |
| STOPPED | Jail intentionally stopped (boot="off"). |
Example output:
calendar UP 4/4 servicesdb UP 3/3 servicesllama STOPPED (boot=off)mail WARN 8/9 services KO: dovecotminecraft-bedrock UP 4/4 serviceswebmail DOWN
Installation and Usage
Install:
install -m 755 jstatus /usr/local/sbin/jstatus
Run as root:
jstatus # Check all jailsjstatus mail db # Check specific jails
Use in automation:
jstatus && echo "all good"
How It Works
- Retrieves the jail list using
bastille list jail. - Checks jail state using
jls. - Identifies enabled services using
service -einside each running jail. - Excludes services marked
nojailand most one-shot startup scripts. - Executes each daemon’s
statuscommand and evaluates its exit code. - Reports failed services without parsing their output.
Configuration
All configuration is optional.
| Variable | Default / Purpose |
|---|---|
JSTATUS_IGNORE | newsyslog; services to exclude |
JSTATUS_BASTILLE_CONF | /usr/local/etc/bastille/bastille.conf |
JSTATUS_JAILSDIR | Read from Bastille configuration |
NO_COLOR | Disables colored output |
Known Limitations
- Process checks only: Does not verify ports, network connectivity, or application responsiveness.
- Service detection: May miss daemons without recognized rc-script variables.
- Status reliability: Depends on the correctness of each service’s
statuscommand. - One-shot scripts: Some may require manual exclusion.
- FreeBSD-specific: Does not support Linux-compatibility jails.
- Bastille dependency: Relies on Bastille’s configuration layout.
Compatibility and License
- Tested on FreeBSD 14.5 with Bastille.
- Written entirely in POSIX shell.
- Licensed under BSD 2-Clause.
- Repository: Creep29257/jstatus on GitHub.





