Skip to content

Commit

Permalink
Merge pull request #2384 from olehermanse/not_running
Browse files Browse the repository at this point in the history
CFE-3472: Changed component restart classes in examples to describe state
  • Loading branch information
nickanderson committed Oct 23, 2020
2 parents 3e29b62 + 8747b8f commit 4fe1e65
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions examples/example-snippets/ensure_running_1.cf
Expand Up @@ -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");

}
4 changes: 2 additions & 2 deletions examples/example-snippets/laptop_support_configuration.cf
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions examples/example-snippets/process_management.cf
Expand Up @@ -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");
}
########################################################
#
Expand All @@ -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";
}
########################################################
Expand Down
Expand Up @@ -29,13 +29,13 @@ vars:
processes:
"$(component)"
restart_class => canonify("start_$(component)"); # Set the class "start_<component>" if it is not running
# Set the class "<component>_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_<component>", CFEngine will run
# the command if "start_<component> is set.
if => canonify("$(component)_not_running");
}
```
Expand Down
4 changes: 2 additions & 2 deletions examples/example-snippets/restart_process_1.cf
Expand Up @@ -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)");

}
4 changes: 2 additions & 2 deletions reference/promise-types.markdown
Expand Up @@ -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:**
Expand Down

0 comments on commit 4fe1e65

Please sign in to comment.