diff --git a/examples/example-snippets/ensure_running_1.cf b/examples/example-snippets/ensure_running_1.cf index 2017e32a8..160a0a820 100644 --- a/examples/example-snippets/ensure_running_1.cf +++ b/examples/example-snippets/ensure_running_1.cf @@ -8,12 +8,12 @@ bundle agent CFEngine_processes "$(components)" comment => "Make sure server parts of CFEngine are running", - restart_class => canonify("start_$(component)"); + restart_class => canonify("$(component)_not_running"); commands: "$(sys.workdir)/bin/$(component)" comment => "Make sure server parts of CFEngine are running", - if => canonify("start_$(components)"); + if => canonify("$(component)_not_running"); } diff --git a/examples/example-snippets/laptop_support_configuration.cf b/examples/example-snippets/laptop_support_configuration.cf index c42f01c0f..cc9f79c67 100644 --- a/examples/example-snippets/laptop_support_configuration.cf +++ b/examples/example-snippets/laptop_support_configuration.cf @@ -60,12 +60,12 @@ bundle agent main edit_defaults => def; processes: - "$(component)" restart_class => canonify("start_$(component)"); + "$(component)" restart_class => canonify("$(component)_not_running"); # - - - - - - - - - - - - - - - - - - - - - - - - commands: "$(sys.workdir)/bin/$(component)" - if => canonify("start_$(component)"); + if => canonify("$(component)_not_running"); } ####################################################### # Backup diff --git a/examples/example-snippets/process_management.cf b/examples/example-snippets/process_management.cf index 471165a22..3f971f1c7 100644 --- a/examples/example-snippets/process_management.cf +++ b/examples/example-snippets/process_management.cf @@ -142,11 +142,11 @@ bundle agent process_restart processes: "$(component)" - restart_class => canonify("start_$(component)"); + restart_class => canonify("$(component)_not_running"); commands: "/var/cfengine/bin/$(component)" - if => canonify("start_$(component)"); + if => canonify("$(component)_not_running"); } ######################################################## # @@ -170,10 +170,10 @@ bundle agent testbundle cfservd_out_of_control:: "cfservd" signals => { "stop" , "term" }, - restart_class => "start_cfserv"; + restart_class => "stopped_out_of_control_cf_serverd"; commands: - start_cfserv:: + stopped_out_of_control_cf_serverd:: "/usr/local/sbin/cfservd"; } ######################################################## diff --git a/examples/example-snippets/promise-patterns/example_process_restart.markdown b/examples/example-snippets/promise-patterns/example_process_restart.markdown index 0e8d20f39..3de77bf7f 100644 --- a/examples/example-snippets/promise-patterns/example_process_restart.markdown +++ b/examples/example-snippets/promise-patterns/example_process_restart.markdown @@ -29,13 +29,13 @@ vars: processes: "$(component)" - restart_class => canonify("start_$(component)"); # Set the class "start_" if it is not running + # Set the class "_not_running" if it is not running: + restart_class => canonify("$(component)_not_running"); commands: "/var/cfengine/bin/$(component)" - if => canonify("start_$(component)"); # Evaluate the class "start_", CFEngine will run - # the command if "start_ is set. + if => canonify("$(component)_not_running"); } ``` diff --git a/examples/example-snippets/restart_process_1.cf b/examples/example-snippets/restart_process_1.cf index 9df0f8f85..c857843e5 100644 --- a/examples/example-snippets/restart_process_1.cf +++ b/examples/example-snippets/restart_process_1.cf @@ -20,11 +20,11 @@ bundle agent process_restart processes: "$(component)" - restart_class => canonify("start_$(component)"); + restart_class => canonify("not_running_$(component)"); commands: "/var/cfengine/bin/$(component)" - if => canonify("start_$(component)"); + if => canonify("not_running_$(component)"); } diff --git a/reference/promise-types.markdown b/reference/promise-types.markdown index 00da13c27..3bba07b56 100644 --- a/reference/promise-types.markdown +++ b/reference/promise-types.markdown @@ -1037,12 +1037,12 @@ and classes. For example: processes: - "$(component)" restart_class => canonify("start_$(component)"); + "$(component)" restart_class => canonify("$(component)_not_runnning"); commands: "/var/cfengine/bin/$(component)" - if => canonify("start_$(component)"); + if => canonify("$(component)_not_runnning"); ``` **Notes:**