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's unique, optional, a string, 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 πŸ‘‘


πŸŽ€ 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