Skip to content

Service Management

The oored binary can run in two modes:

Foreground Mode

Run directly in your terminal for development (oored run)

Service Mode

Run as a system daemon that starts at boot

Service mode is recommended for production deployments.

Quick Start

Terminal window
# Build the server
cargo build --release -p oore-server
# Install as system service
sudo ./target/release/oored install
# Edit configuration
sudo nano /etc/oore/oore.env
# Start the service
sudo oored start
# Check status
oored status
# View logs
oored logs -f

Commands Reference

oored run

Run the server in foreground mode.

Terminal window
oored run
# or simply
oored

oored install

Install as a system service. Requires root.

Terminal window
sudo oored install [--env-file <PATH>] [--force]
OptionDescription
--env-file <PATH>Custom environment file to copy
--force, -fForce reinstall

What it does:

  1. Creates directories: /var/lib/oore, /var/log/oore, /etc/oore
  2. Copies binary to /usr/local/bin/oored
  3. Copies/creates environment file at /etc/oore/oore.env
  4. Writes service definition (launchd/systemd)
  5. Configures log rotation
  6. Enables the service (but does not start it)

oored uninstall

Remove the system service.

Terminal window
sudo oored uninstall [--purge]
OptionDescription
--purgeAlso remove data, logs, and configuration

oored start / stop / restart

Control the service.

Terminal window
sudo oored start
sudo oored stop
sudo oored restart

oored status

Show service status.

Terminal window
oored status
Status: Installed
Running: Yes
PID: 12345
Binary: /usr/local/bin/oored
Logs: /var/log/oore/oored.log

oored logs

View service logs.

Terminal window
oored logs # Last 50 lines
oored logs -n 100 # Last 100 lines
oored logs -f # Follow in real-time

Troubleshooting

Service Won’t Start

Database permission error:

Error: unable to open database file

Ensure /var/lib/oore exists and is writable.

Port already in use:

Error: Address already in use

Check what’s using port 8080:

Terminal window
sudo lsof -i :8080

Missing configuration:

Error: DATABASE_URL must be set

Edit /etc/oore/oore.env and add required variables.

macOS: “Operation not permitted”

  1. Ensure you’re using sudo
  2. Check Terminal.app has Full Disk Access (System Preferences > Privacy)

Platform Details

Service definition: /Library/LaunchDaemons/build.oore.oored.plist

Key features:

  • RunAtLoad: Starts at boot
  • KeepAlive: Restarts on crash
  • ThrottleInterval: 5 seconds between restarts

Commands:

Terminal window
launchctl bootstrap system /path/to/plist # Load
launchctl bootout system/build.oore.oored # Unload
launchctl kickstart -kp system/build.oore.oored # Start

Log rotation: newsyslog at /etc/newsyslog.d/oore.conf

File Layout

/usr/local/bin/oored # Binary
/etc/oore/oore.env # Configuration
/var/lib/oore/oore.db # Database
/var/log/oore/oored.log # Logs
# macOS
/Library/LaunchDaemons/build.oore.oored.plist
# Linux
/etc/systemd/system/oored.service