Product SiteDocumentation Site

Pacemaker Development

Working with the Pacemaker Code Base

Edition 2

Written by the Pacemaker project contributors

Legal Notice

Copyright © 2016-2020 The Pacemaker project contributors.
The text of and illustrations in this document are licensed under version 4.0 or later of the Creative Commons Attribution-ShareAlike International Public License ("CC-BY-SA")[1].
In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
In addition to the requirements of this license, the following activities are looked upon favorably:
  1. If you are distributing Open Publication works on hardcopy or CD-ROM, you provide email notification to the authors of your intent to redistribute at least thirty days before your manuscript or media freeze, to give the authors time to provide updated documents. This notification should describe modifications, if any, made to the document.
  2. All substantive modifications (including deletions) be either clearly marked up in the document or else described in an attachment to the document.
  3. Finally, while it is not mandatory under this license, it is considered good form to offer a free copy of any hardcopy or CD-ROM expression of the author(s) work.


This document has guidelines and tips for developers interested in editing Pacemaker source code and submitting changes for inclusion in the project.

Table of Contents

1. Frequently Asked Questions
2. General Guidelines for All Languages
2.1. Copyright
3. C Coding Guidelines
3.1. Style Guidelines
3.1.1. C Boilerplate
3.1.2. Line Formatting
3.1.3. Pointers
3.1.4. Function Definitions
3.1.5. Control Statements (if, else, while, for, switch)
3.1.6. Operators
3.2. Best Practices
3.2.1. New Struct and Enum Members
3.2.2. Documentation
3.2.3. Symbol Naming
3.2.4. Memory Allocation
3.2.5. Logging
3.2.6. Regular Expressions
3.2.7. vim Settings
4. Python Coding Guidelines
4.1. Python Boilerplate
4.2. Python Compatibility
4.2.1. Python Future Imports
4.2.2. Other Python Compatibility Requirements
4.2.3. Python Usages to Avoid
4.3. Formatting Python Code
5. Evolution of the project
5.1. Foreword
5.2. Common ancestor: heartbeat project
5.2.1. Influence of heartbeat on Pacemaker
5.3. Notable Restructuring Steps in the Codebase
6. Advanced Hacking on the Project
6.1. Foreword
6.2. Debugging
6.3. Working with mocked daemons
A. Revision History

List of Examples

2.1. Copyright Notice Format