PCS consists of several components that together provide cluster management capabilities:
-
CLI (
pcs/pcs)- Command-line interface for cluster management
- Entry point:
pcs/entry_points/ - Command implementations:
pcs/cli/
-
Library (
pcs/lib/)- Core business logic
- Commands:
pcs/lib/commands/(invoked by both CLI and daemon)
-
Daemon — pcsd (HTTP server for remote management)
- Tornado daemon (Python) —
pcs/daemon/- Main implementation, actively developed
- Entry point:
pcs/daemon/run.py - Default port: 2224
- Ruby daemon (legacy) —
pcsd/- Original Sinatra-based implementation
- Still runs alongside Tornado for endpoints not yet migrated
- Being phased out
- Tornado daemon (Python) —
See daemon.md for daemon internals, API layers, APIv2 architecture, and authentication.
Utilities shared by core components are placed in pcs/common/.
-
Web UI (optional, separate project)
- Not part of pcs sources
- Separate repository: pcs-web-ui
- Can run as Cockpit plugin or standalone app served by pcsd
- Enabled via
--enable-webuiconfigure flag - pcsd provides backend API support when enabled
-
SNMP Agent (
pcs/snmp/)- Optional SNMP monitoring support
- Executable:
pcs_snmp_agent - AgentX-based SNMP subagent
The CLI and daemon are two different entry points into the same library layer. The CLI is used for local, interactive management; the daemon enables remote management and async task processing over HTTP.
User (CLI) Remote client / Web UI
│ │
pcs/cli/ pcs/daemon/
│ │
└──── pcs/lib/commands/ ┘
│
pcs/lib/cib/ (CIB manipulation)
pcs/common/ (DTOs, reports, types)
pcs/lib/env.py (command dependencies container)
See library.md for how the library layer works: commands, LibraryEnvironment, CIB access, reports, and communication. See cli.md for the CLI pipeline, routing, and middleware.
| Directory | Purpose |
|---|---|
pcs/ |
CLI entry point |
pcs/lib/ |
Core library (business logic) |
pcs/lib/commands/ |
Library commands (invoked by daemon, CLI) |
pcs/common/ |
Shared types, DTOs, reports |
pcs/daemon/ |
pcsd daemon (Tornado server) |
pcs/daemon/app/ |
HTTP handlers |
pcs/daemon/async_tasks/ |
Async task processing |
pcsd/ |
Ruby legacy daemon code |
pcs_test/ |
Test suite (see testing.md) |
The project uses GNU Autotools. See CONTRIBUTING.md for
setup commands (autogen.sh, ./configure, make) and configure flags.
autogen.sh → configure → make
(autoreconf -i -v) (from .ac) (from Makefile.am)
autogen.shrunsautoreconfto generate theconfigurescript fromconfigure.ac./configurechecks dependencies and generatesMakefile(and other files) from*.intemplatesmakebuilds, installs dependencies, and runs targets
When modifying the build system, edit the source files — never the generated ones:
| Edit these (source) | Don't edit (generated) |
|---|---|
configure.ac |
configure, config.status, config.log |
Makefile.am |
Makefile, Makefile.in |
*.in templates |
Their output files (without .in suffix) |
m4/*.m4 (custom macros) |
aclocal.m4, autom4te.cache/ |
Generated files are listed in .gitignore. After editing any .in file or
configure.ac, re-run ./configure (or make will do it automatically if
timestamps trigger autotools re-generation).
EXTRA_DIST— files included in distribution tarballs (make dist). All distributed files must be listed here (except autotools-generated ones).MAINTAINERCLEANFILES— generated files removed bymake maintainer-clean. When a new generated file appears in the tree, add it here.- Entries in list variables (
EXTRA_DIST,MAINTAINERCLEANFILES, etc.) are kept in alphabetical order.
Generated and temporary files are listed in .gitignore. Tools like typos
and ruff respect .gitignore by default, so adding a file to .gitignore
automatically excludes it from quality checks as well.
make check runs the full quality-check pipeline, defined as the check-local
target in Makefile.am:
typos_check → ruff_lint → ruff_isort_check → ruff_format_check → mypy
→ tests_tier0 → tests_tier1 → pcsd-tests
Individual checks can be run separately (e.g. make typos_check, make mypy).
See CONTRIBUTING.md for the full list of make targets.
| Tool | Config file(s) | Notes |
|---|---|---|
typos |
typos.toml, typos_known |
Baseline-diff approach (see below) |
ruff |
pyproject.toml |
Linting, import sorting, formatting |
mypy |
mypy.ini |
Static type checking |
The typos checker uses a baseline-diff approach:
typosscans the tree and produces a sorted list of findings- The list is compared against
typos_known(committed baseline) - If they differ, the check fails
This means:
- New typos cause failure (they appear in output but not in baseline)
- Fixed typos also cause failure (they're in baseline but not in output)
- To update the baseline after intentional changes:
make typos_known typos.tomlconfigures exclusions (extend-exclude) and known words (extend-words) that are project-specific false positives
Each major component has a dedicated document with in-depth coverage:
- library.md — library commands, LibraryEnvironment, CorosyncConfigFacade, network communication
- cib.md — CIB-modifying commands, section access, CIB domain layer
- reports.md — reporting system, error signaling, force override pattern
- daemon.md — daemon architecture, API layers (v0/v1/v2), APIv2 in depth, authentication, command permissions
- cli.md — CLI pipeline, command routing, middleware, force flags