OCF_HEARTBEAT_STATEF(7)
π ocf_heartbeat_Stateful β bestie edition
okay so you found the OCF_HEARTBEAT_STATEF(7) page, and yes it's from the OCF resource agents manual fam β pull up a chair, we're gonna go through this together π«Ά
β¨ NAME β¨
ocf_heartbeat_Stateful β literally just an example stateful resource agent. that's it. that's the whole name. iconic of it honestly π
πΈ SYNOPSIS πΈ
Stateful [start | stop | monitor | promote | demote | meta-data |
validate-all]
that's the whole vibe check β pick one of those actions and go π
π¦ DESCRIPTION π¦
so this is an example resource agent (emphasis on example, bestie, it's a demo) that implements two states. two. a duo. main character energy and its supporting cast β¨
π SUPPORTED PARAMETERS π
stateβ the location where you store the resource state. it'sunique,optional, astring, and it defaults to"/run/resource-agents/Stateful-RESOURCE_ID.state"β yes that's the default, don't come for me, I didn't pick it π
β SUPPORTED ACTIONS β
this resource agent supports the following actions (aka operations), and I'm listing every single one because we don't skip around here:
startβ starts the resource. suggested minimum timeout:20s.stopβ stops the resource. suggested minimum timeout:20s.promoteβ promotes the resource to the Master role. suggested minimum timeout:20s.demoteβ demotes the resource to the Slave role. suggested minimum timeout:20s.monitorβ does a detailed status check. suggested minimum timeout:20s, and suggested interval:10s.meta-dataβ retrieves the resource agent metadata β internal use only, so like, don't touch unless you're supposed to π. suggested minimum timeout:5s.validate-allβ validates the resource configuration. suggested minimum timeout:20s.
π₯ EXAMPLE CRM SHELL π₯
here's an example config for a Stateful resource using the crm(8) shell β copying it exactly because this is the part you'll actually need:
primitive p_Stateful ocf:heartbeat:Stateful \
op monitor depth="0" timeout="20s" interval="10s"
ms ms_Stateful p_Stateful \
meta notify="true" interleave="true"
the way that's a whole primitive and a master/slave setup in one little block π slay
π EXAMPLE PCS π
and here's the same energy for pcs(8):
pcs resource create p_Stateful ocf:heartbeat:Stateful \
op monitor OCF_CHECK_LEVEL="0" timeout="20s" interval="10s" promotable
note the promotable at the end β that's what makes it, you know, stateful. periodt π
π SEE ALSO π
http://clusterlabs.org/β go look, it's the clusterlabs site, they know things β¨
π AUTHOR π
ClusterLabs contributors β and if you wanna know about individual authors, the resource agent source has that info for you π«Ά
and that's the page!! no cap, you now understand ocf_heartbeat_Stateful(7) better than most people π
fr fr though β it's an example agent, so don't go putting it in production and then acting surprised. you've been warned π
k bye bestie, go slay some clusters πΈ
β this adorable little page came from resource-agents version UNKNOWN, dated 10/01/2026. archive it, frame it, obsess over it π
π¦ where this page comes from
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms