Improve unit generation for docker, podman, scripts and programs #4

Open
opened 2026-04-03 13:57:12 +00:00 by sgcommand · 0 comments
Member

The current generator covers basic container start/stop. Expand it to properly handle each runtime type.

Docker

  • Depend on docker.service: Requires=docker.service / After=docker.service
  • Handle docker compose as a runtime option

Podman

  • Depend on podman.socket where appropriate
  • Support podman pods (not just containers)
  • Handle rootless linger: warn if loginctl enable-linger <user> has not been run

Scripts / Programs

  • New runtime type: exec — runs an arbitrary script or binary directly
  • ExecStart set from command field, no container wrapper
  • Useful for managing non-container services alongside containers in the same config
  • Example:
- name: myworker
  runtime: exec
  command: /opt/myapp/worker.sh
  order: 3
  enabled: true

General

  • Type=forking option for containers that daemonise themselves
  • TimeoutStopSec configurable per unit
  • EnvironmentFile support
The current generator covers basic container start/stop. Expand it to properly handle each runtime type. ## Docker - Depend on `docker.service`: `Requires=docker.service` / `After=docker.service` - Handle `docker compose` as a runtime option ## Podman - Depend on `podman.socket` where appropriate - Support podman pods (not just containers) - Handle rootless linger: warn if `loginctl enable-linger <user>` has not been run ## Scripts / Programs - New runtime type: `exec` — runs an arbitrary script or binary directly - `ExecStart` set from `command` field, no container wrapper - Useful for managing non-container services alongside containers in the same config - Example: ```yaml - name: myworker runtime: exec command: /opt/myapp/worker.sh order: 3 enabled: true ``` ## General - `Type=forking` option for containers that daemonise themselves - `TimeoutStopSec` configurable per unit - `EnvironmentFile` support
Sign in to join this conversation.