michaelmelanson / michaelmelanson/panda-os

Service manager step 5: TOML parsing and service config

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement userspace
Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Summary

Add TOML config parsing to init for reading service definitions from /config/services/{name}/config.toml. Each config specifies the service binary, dependencies, restart policy, and optional protocol.

This is step 5 of the service manager implementation (#26).

Desired behaviour

  • Add the toml crate (v0.9, no_std compatible) to init
  • Parse ServiceConfig from TOML files at /config/services/{name}/config.toml
  • Config fields:
    • binary: path to the service executable
    • args: optional command-line arguments
    • dependencies: list of service names this service depends on
    • restart: restart policy (always, on-failure, never)
    • protocol: optional protocol name for protocol-based service discovery
    • stop_timeout: grace period before SIGKILL after SIGTERM (default: 5s)

Example config

[service]
binary = "/initrd/terminal"
dependencies = ["keyboard"]
restart = "always"
protocol = "console"
stop_timeout = 5

Key files

  • userspace/init/Cargo.toml — add toml dependency
  • userspace/init/src/ServiceConfig struct and parser
  • Config files in rootfs/config/services/ or embedded in initrd

Testing

  • Unit tests for config parsing (valid configs, missing fields, invalid values)
  • Test that all example configs parse correctly
  • Test error reporting for malformed TOML

Documentation

  • Document the config format with all supported fields
  • Provide example configs for each built-in service
  • Document the config search path and loading order

Part of #26

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with userspace/init/Cargo.toml and inspect userspace/init/src/ for the existing ServiceConfig or service-manager entry points. Review the config files in rootfs/config/services/ and add unit coverage for valid, missing-field, invalid-value, and malformed TOML cases. Done means the documented fields and search path are supported and all example configs parse successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.