Product SiteDocumentation Site

9.6. Reloading Services After a Definition Change

The cluster automatically detects changes to the definition of services it manages. The normal response is to stop the service (using the old definition) and start it again (with the new definition). This works well, but some services are smarter and can be told to use a new set of options without restarting.
To take advantage of this capability, the resource agent must:
  1. Accept the reload operation and perform any required actions. The actions here depend completely on your application!

    Example 9.8. The DRBD agent’s logic for supporting reload

    case $1 in
            exit $OCF_ERR_UNIMPLEMENTED
    exit $?

  2. Advertise the reload operation in the actions section of its metadata

    Example 9.9. The DRBD Agent Advertising Support for the reload Operation

    <?xml version="1.0"?>
      <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
      <resource-agent name="drbd">
          Master/Slave OCF Resource Agent for DRBD
          <action name="start"   timeout="240" />
          <action name="reload"  timeout="240" />
          <action name="promote" timeout="90" />
          <action name="demote"  timeout="90" />
          <action name="notify"  timeout="90" />
          <action name="stop"    timeout="100" />
          <action name="meta-data"    timeout="5" />
          <action name="validate-all" timeout="30" />

  3. Advertise one or more parameters that can take effect using reload.
    Any parameter with the unique set to 0 is eligible to be used in this way.

    Example 9.10. Parameter that can be changed using reload

    <parameter name="drbdconf" unique="0">
        <longdesc>Full path to the drbd.conf file.</longdesc>
        <shortdesc>Path to drbd.conf</shortdesc>
        <content type="string" default="${OCF_RESKEY_drbdconf_default}"/>

Once these requirements are satisfied, the cluster will automatically know to reload the resource (instead of restarting) when a non-unique field changes.


Metadata will not be re-read unless the resource needs to be started. This may mean that the resource will be restarted the first time, even though you changed a parameter with unique=0.


If both a unique and non-unique field are changed simultaneously, the resource will still be restarted.