apt-ostree/.notes/rpm-ostree/service-files/rpm-ostree-bootstatus.service.md

2.7 KiB

rpm-ostree-bootstatus.service

Overview

Boot-time service that logs the current deployment status to the system journal. This provides an audit trail for system state and helps with troubleshooting and monitoring.

Service File

[Unit]
Description=Log rpm-ostree Booted Deployment Status To Journal
Documentation=man:rpm-ostree(1)
ConditionPathExists=/run/ostree-booted

[Service]
Type=oneshot
ExecStart=rpm-ostree status -b
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Key Components

Unit Section

  • Description: Human-readable description of the service
  • Documentation: Reference to manual page
  • ConditionPathExists=/run/ostree-booted: Only run on OSTree-booted systems

Service Section

  • Type=oneshot: Run once and exit
  • ExecStart=rpm-ostree status -b: Execute status command for booted deployment
  • RemainAfterExit=yes: Keep service marked as active after completion

Install Section

  • WantedBy=multi-user.target: Start when system reaches multi-user target

What It Does

Core Functions

  1. Boot Status Logging: Records which deployment is currently booted
  2. Audit Trail: Provides system state information in journal
  3. Troubleshooting: Helps diagnose deployment issues
  4. Monitoring: Enables system monitoring and alerting

Command Details

The rpm-ostree status -b command:

  • Shows information about the currently booted deployment
  • Includes deployment checksum, version, and origin
  • Lists installed packages and modifications
  • Reports deployment health and status

Journal Integration

The service output is automatically logged to:

  • systemd journal (journalctl)
  • Boot logs (journalctl -b)
  • System logs for monitoring and analysis

Use Cases

System Administration

  • Deployment Tracking: Know which deployment is active
  • Rollback Verification: Confirm rollback operations
  • System Health: Monitor deployment status over time

Troubleshooting

  • Boot Issues: Identify deployment problems
  • Package Conflicts: Detect package installation issues
  • System State: Understand current system configuration

Monitoring

  • Alerting: Trigger alerts for deployment changes
  • Compliance: Track system configuration compliance
  • Auditing: Maintain audit trail for security

Dependencies

  • OSTree-booted system (/run/ostree-booted)
  • rpm-ostree command-line tool
  • systemd journal
  • Multi-user target

apt-ostree Equivalent

For apt-ostree, this would be apt-ostree-bootstatus.service with:

  • Command: apt-ostree status -b
  • APT-specific status information
  • Debian/Ubuntu deployment details
  • Package management status
  • System configuration logging