]> Kevux Git Server - fll/commitdiff
Refactor: Rename "script" setting to "engine".
authorKevin Day <thekevinday@gmail.com>
Tue, 5 Jul 2022 13:43:31 +0000 (08:43 -0500)
committerKevin Day <thekevinday@gmail.com>
Tue, 5 Jul 2022 13:43:31 +0000 (08:43 -0500)
The scripting engine is now called "engine".
This fixes ambiguity issues between the "script" action and the scripting engine.
This makes the code and configuration files easier to read and understand.

24 files changed:
level_3/controller/c/common.h
level_3/controller/c/common/private-common.c
level_3/controller/c/common/private-common.h
level_3/controller/c/common/private-rule.c
level_3/controller/c/common/private-rule.h
level_3/controller/c/common/private-task.c
level_3/controller/c/common/private-task.h
level_3/controller/c/main-common.c
level_3/controller/c/main-common.h
level_3/controller/c/main.c
level_3/controller/c/rule/private-rule.c
level_3/controller/c/rule/private-rule_print.c
level_3/controller/data/build/defines
level_3/controller/data/settings/example/rules/environment/default.rule
level_3/controller/data/settings/example/rules/environment/empty.rule
level_3/controller/data/settings/example/rules/environment/exported.rule
level_3/controller/data/settings/example/rules/environment/exporting.rule
level_3/controller/data/settings/example/rules/maintenance/boom.rule
level_3/controller/data/settings/example/rules/script/php.rule
level_3/controller/data/settings/example/rules/script/python.rule
level_3/controller/data/settings/example/rules/script/require_me.rule
level_3/controller/data/settings/example/rules/script/succeed.rule
level_3/controller/documents/rule.txt
level_3/controller/specifications/rule.txt

index 938a15923d253dccc1d4b431e1f7d46234c99ca8..2e851c79f7606992cef46952072440078a7a1212 100644 (file)
@@ -167,22 +167,30 @@ extern "C" {
 /**
  * The main program data.
  *
- * child:                Reserved for a child process, often representing the child return status or the child process ID.
- * context:              The color context.
- * default_path_setting: The default setting path.
- * default_path_pid:     The default PID file path.
- * default_path_socket:  The default socket file path.
- * error:                The output file for error printing.
- * as_init:              Designate whether or not this is running as an init program.
- * output:               The output file for general printing.
- * parameters:           The state of pre-defined parameters passed to the program.
- * pid:                  The PID of the program.
- * process_pipe:         Designate whether or not to process the input pipe.
- * program_name:         The name of the program.
- * program_name_long:    The long name of the program.
- * signal:               The process signal management structure.
- * umask:                The umask settings, needed for avoiding calls to umask() to read the current umask.
- * warning:              The output file for warning printing.
+ * child:                      Reserved for a child process, often representing the child return status or the child process ID.
+ * context:                    The color context.
+ * default_engine:             The default scripting engine.
+ * default_path_pid:           The default PID file path.
+ * default_path_pid_init:      The default PID file path, when run as init.
+ * default_path_pid_prefix:    The default PID file path prefix.
+ * default_path_pid_suffix:    The default PID file path suffix.
+ * default_path_setting:       The default setting path.
+ * default_path_setting_init:  The default setting path, when run as init.
+ * default_path_socket:        The default socket file path.
+ * default_path_socket_init:   The default socket file path, when run as init.
+ * default_path_socket_prefix: The default socket file path prefix.
+ * default_path_socket_suffix: The default socket file path suffix.
+ * error:                      The output file for error printing.
+ * as_init:                    Designate whether or not this is running as an init program.
+ * output:                     The output file for general printing.
+ * parameters:                 The state of pre-defined parameters passed to the program.
+ * pid:                        The PID of the program.
+ * process_pipe:               Designate whether or not to process the input pipe.
+ * program_name:               The name of the program.
+ * program_name_long:          The long name of the program.
+ * signal:                     The process signal management structure.
+ * umask:                      The umask settings, needed for avoiding calls to umask() to read the current umask.
+ * warning:                    The output file for warning printing.
  */
 #ifndef _di_controller_main_t_
   typedef struct {
@@ -201,6 +209,7 @@ extern "C" {
     mode_t umask;
     int child;
 
+    const f_string_static_t *default_engine;
     const f_string_static_t *default_path_pid;
     const f_string_static_t *default_path_pid_init;
     const f_string_static_t *default_path_pid_prefix;
@@ -211,7 +220,6 @@ extern "C" {
     const f_string_static_t *default_path_socket_init;
     const f_string_static_t *default_path_socket_prefix;
     const f_string_static_t *default_path_socket_suffix;
-    const f_string_static_t *default_program_script;
     const f_string_static_t *program_name;
     const f_string_static_t *program_name_long;
 
index bced2e73cd0a27decd3c66cb0bfd58995524d0e0..6cb1c2e37261f2d2825d0fd53b13389aa96cffa9 100644 (file)
@@ -31,6 +31,7 @@ extern "C" {
   const f_string_static_t controller_define_s = macro_f_string_static_t_initialize(CONTROLLER_define_s, 0, CONTROLLER_define_s_length);
   const f_string_static_t controller_delay_s = macro_f_string_static_t_initialize(CONTROLLER_delay_s, 0, CONTROLLER_delay_s_length);
   const f_string_static_t controller_disable_s = macro_f_string_static_t_initialize(CONTROLLER_disable_s, 0, CONTROLLER_disable_s_length);
+  const f_string_static_t controller_engine_s = macro_f_string_static_t_initialize(CONTROLLER_engine_s, 0, CONTROLLER_engine_s_length);
   const f_string_static_t controller_entry_s = macro_f_string_static_t_initialize(CONTROLLER_entry_s, 0, CONTROLLER_entry_s_length);
   const f_string_static_t controller_entries_s = macro_f_string_static_t_initialize(CONTROLLER_entries_s, 0, CONTROLLER_entries_s_length);
   const f_string_static_t controller_environment_s = macro_f_string_static_t_initialize(CONTROLLER_environment_s, 0, CONTROLLER_environment_s_length);
index c0cf3c00ee9446b3db6cde95612cf496f7e6d083..e2659827a6b08144c24b8287c7568f387ed15cb4 100644 (file)
@@ -56,6 +56,7 @@ extern "C" {
   #define CONTROLLER_define_s        "define"
   #define CONTROLLER_delay_s         "delay"
   #define CONTROLLER_disable_s       "disable"
+  #define CONTROLLER_engine_s        "engine"
   #define CONTROLLER_entry_s         "entry"
   #define CONTROLLER_entries_s       "entries"
   #define CONTROLLER_environment_s   "environment"
@@ -186,6 +187,7 @@ extern "C" {
   #define CONTROLLER_define_s_length        6
   #define CONTROLLER_delay_s_length         5
   #define CONTROLLER_disable_s_length       7
+  #define CONTROLLER_engine_s_length        6
   #define CONTROLLER_entry_s_length         5
   #define CONTROLLER_entries_s_length       7
   #define CONTROLLER_environment_s_length   11
@@ -316,6 +318,7 @@ extern "C" {
   extern const f_string_static_t controller_define_s;
   extern const f_string_static_t controller_delay_s;
   extern const f_string_static_t controller_disable_s;
+  extern const f_string_static_t controller_engine_s;
   extern const f_string_static_t controller_entry_s;
   extern const f_string_static_t controller_entries_s;
   extern const f_string_static_t controller_environment_s;
index a638272a373f617f27ceedcea54cabcd83830175..ecd60b1b4a6b1ed1ba54c69a913f88155f0fc6e9 100644 (file)
@@ -57,9 +57,9 @@ extern "C" {
   void controller_rule_delete_simple(controller_rule_t * const rule) {
 
     f_string_dynamic_resize(0, &rule->alias);
+    f_string_dynamic_resize(0, &rule->engine);
     f_string_dynamic_resize(0, &rule->name);
     f_string_dynamic_resize(0, &rule->path);
-    f_string_dynamic_resize(0, &rule->script);
 
     f_string_maps_resize(0, &rule->define);
     f_string_maps_resize(0, &rule->parameter);
index bba37027145a7bbf3504e109910b97629b887fa7..d454a9239a500ced647be58efac2133d5a779467 100644 (file)
@@ -265,6 +265,7 @@ extern "C" {
  *   - capability:  Setting type representing a capability.
  *   - cgroup:      Setting type representing a control group.
  *   - define:      Setting type representing a define.
+ *   - engine:      Setting type representing a engine.
  *   - environment: Setting type representing a environment.
  *   - group:       Setting type representing a group.
  *   - limit:       Setting type representing a limit.
@@ -274,7 +275,6 @@ extern "C" {
  *   - parameter:   Setting type representing a parameter.
  *   - path:        Setting type representing a path.
  *   - scheduler:   Setting type representing a scheduler.
- *   - script:      Setting type representing a script.
  *   - user:        Setting type representing a user.
  *
  * controller_rule_has_*:
@@ -289,6 +289,7 @@ extern "C" {
  * capability:    The capability setting if the Rule "has" a capability.
  * cgroup:        The control group setting if the Rule "has" a control group.
  * define:        Any defines (environment variables) made available to the Rule for IKI substitution or just as environment variables.
+ * engine:        The program or path to the program of the scripting engine to use when processing scripts in this Rule.
  * environment:   All environment variables allowed to be exposed to the Rule when processing.
  * group:         The group ID if the Rule "has" a group.
  * groups:        A set of group IDs to run the process with (first specified group is the primary group).
@@ -301,7 +302,6 @@ extern "C" {
  * parameter:     Any parameters made available to the Rule for IKI substitution.
  * path:          The path to the Rule file.
  * scheduler:     The scheduler setting if the Rule "has" a scheduler.
- * script:        The program or path to the program of the scripting engine to use when processing scripts in this Rule.
  * status:        A set of action-specific success/failure status of the Rule. Each index represents a controller_rule_action_type_* enum value. Index 0 represents a global status.
  * timeout_kill:  The timeout to wait relating to using a kill signal.
  * timeout_start: The timeout to wait relating to starting a process.
@@ -315,6 +315,7 @@ extern "C" {
     controller_rule_setting_type_capability_e,
     controller_rule_setting_type_cgroup_e,
     controller_rule_setting_type_define_e,
+    controller_rule_setting_type_engine_e,
     controller_rule_setting_type_environment_e,
     controller_rule_setting_type_group_e,
     controller_rule_setting_type_limit_e,
@@ -324,7 +325,6 @@ extern "C" {
     controller_rule_setting_type_parameter_e,
     controller_rule_setting_type_path_e,
     controller_rule_setting_type_scheduler_e,
-    controller_rule_setting_type_script_e,
     controller_rule_setting_type_timeout_e,
     controller_rule_setting_type_user_e,
   };
@@ -357,9 +357,9 @@ extern "C" {
     f_time_spec_t timestamp;
 
     f_string_dynamic_t alias;
+    f_string_dynamic_t engine;
     f_string_dynamic_t name;
     f_string_dynamic_t path;
-    f_string_dynamic_t script;
 
     f_string_maps_t define;
     f_string_maps_t parameter;
index 08f5396fc57afd58c8441a2364f97ffb2e438682..d50f4e90c835f2a035dc13a2d03115cd49578e58 100644 (file)
@@ -52,10 +52,10 @@ extern "C" {
   void controller_task_delete_simple(controller_task_t * const task) {
 
     f_string_dynamic_resize(0, &task->alias);
+    f_string_dynamic_resize(0, &task->engine);
     f_string_dynamic_resize(0, &task->help);
     f_string_dynamic_resize(0, &task->name);
     f_string_dynamic_resize(0, &task->path);
-    f_string_dynamic_resize(0, &task->script);
 
     f_string_maps_resize(0, &task->arguments);
     f_string_maps_resize(0, &task->defines);
index f4504990d6b02dec75ddc80e197532ee23edc4fa..eec60d325434d2606da3c83b2b14e679ad705d8c 100644 (file)
@@ -81,11 +81,12 @@ extern "C" {
  * A Task structure.
  *
  * controller_task_setting_type_*:
- *   - affinity:    Setting type representing a affinity.
+ *   - affinity:    Setting type representing an affinity.
  *   - capability:  Setting type representing a capability.
  *   - cgroup:      Setting type representing a cgroup (control group).
  *   - define:      Setting type representing a define.
- *   - environment: Setting type representing a environment.
+ *   - engine:      Setting type representing an engine.
+ *   - environment: Setting type representing an environment.
  *   - group:       Setting type representing a group.
  *   - limit:       Setting type representing a limit.
  *   - name:        Setting type representing a name.
@@ -93,7 +94,6 @@ extern "C" {
  *   - parameter:   Setting type representing a parameter.
  *   - path:        Setting type representing a path.
  *   - scheduler:   Setting type representing a scheduler.
- *   - script:      Setting type representing a script.
  *   - user:        Setting type representing a user.
  *
  * controller_task_has_*:
@@ -109,6 +109,7 @@ extern "C" {
  * capability:  The capability setting if the Task "has" a capability.
  * cgroup:      The cgroup (control group) setting if the Task "has" a cgroup (control group).
  * define:      Any defines (environment variables) made available to the Task for IKI substitution or just as environment variables.
+ * engine:      The program or path to the program of the scripting engine to use when processing scripts in this Task.
  * environment: All environment variables allowed to be exposed to the Task when processing.
  * group:       The group ID if the Task "has" a group.
  * groups:      A set of group IDs to run the process with (first specified group is the primary group).
@@ -119,7 +120,6 @@ extern "C" {
  * parameter:   Any parameters made available to the Task for IKI substitution.
  * path:        The path to the Task file.
  * scheduler:   The scheduler setting if the Task "has" a scheduler.
- * script:      The program or path to the program of the scripting engine to use when processing scripts in this Task.
  * state:       The current active/inactive state of the Task.
  * status:      The last returned status of the Task.
  * timestamp:   The timestamp when the Task was last updated.
@@ -131,6 +131,7 @@ extern "C" {
     controller_task_setting_type_capability_e,
     controller_task_setting_type_cgroup_e,
     controller_task_setting_type_define_e,
+    controller_task_setting_type_engine_e,
     controller_task_setting_type_environment_e,
     controller_task_setting_type_group_e,
     controller_task_setting_type_limit_e,
@@ -139,7 +140,6 @@ extern "C" {
     controller_task_setting_type_parameter_e,
     controller_task_setting_type_path_e,
     controller_task_setting_type_scheduler_e,
-    controller_task_setting_type_script_e,
     controller_task_setting_type_user_e,
   };
 
@@ -163,10 +163,10 @@ extern "C" {
     f_time_spec_t timestamp;
 
     f_string_dynamic_t alias;
+    f_string_dynamic_t engine;
     f_string_dynamic_t help;
     f_string_dynamic_t name;
     f_string_dynamic_t path;
-    f_string_dynamic_t script;
 
     f_string_maps_t arguments;
     f_string_maps_t defines;
index bae8976cd7f8914c021e7794f8c79fba4c091bbc..49a9afc20262eb92af6aa6a2b9472871b1df2882 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 #endif // _di_controller_program_name_
 
 #ifndef _di_controller_defines_
-  const f_string_static_t controller_default_program_script_s = macro_f_string_static_t_initialize(CONTROLLER_default_program_script_s, 0, CONTROLLER_default_program_script_s_length);
+  const f_string_static_t controller_default_engine_s = macro_f_string_static_t_initialize(CONTROLLER_default_engine_s, 0, CONTROLLER_default_engine_s_length);
   const f_string_static_t controller_path_pid_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_s, 0, CONTROLLER_path_pid_s_length);
   const f_string_static_t controller_path_pid_init_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_init_s, 0, CONTROLLER_path_pid_init_s_length);
   const f_string_static_t controller_path_pid_prefix_s = macro_f_string_static_t_initialize(CONTROLLER_path_pid_prefix_s, 0, CONTROLLER_path_pid_prefix_s_length);
index 065342192625ea75b47d5fbaf9c65b94cd92249c..bfb5271902ca64c204a5c4725d4c29b4a7ea18cc 100644 (file)
@@ -150,14 +150,14 @@ extern "C" {
   #endif // defined(_override_controller_path_socket_suffix_) && defined(_override_controller_path_socket_suffix_length_)
 
   #if defined(_override_controller_default_program_script_) && defined(_override_controller_default_program_script_length_)
-    #define CONTROLLER_default_program_script_s        _override_controller_default_program_script_
-    #define CONTROLLER_default_program_script_s_length _override_controller_default_program_script_length_
+    #define CONTROLLER_default_engine_s        _override_controller_default_engine_
+    #define CONTROLLER_default_engine_s_length _override_controller_default_engine_length_
   #else
-    #define CONTROLLER_default_program_script_s        "bash"
-    #define CONTROLLER_default_program_script_s_length 4
+    #define CONTROLLER_default_engine_s        "bash"
+    #define CONTROLLER_default_engine_s_length 4
   #endif // defined(_override_controller_default_program_script_) && defined(_override_controller_default_program_script_length_)
 
-  extern const f_string_static_t controller_default_program_script_s;
+  extern const f_string_static_t controller_default_engine_s;
   extern const f_string_static_t controller_path_pid_s;
   extern const f_string_static_t controller_path_pid_init_s;
   extern const f_string_static_t controller_path_pid_prefix_s;
index c8698bf91c131afcaf0e445273fadd55d6bb06c0..b4b8570e37e134c6b299abcf4a93bb84f6e91bb4 100644 (file)
@@ -20,6 +20,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   f_file_umask_get(&data.umask);
 
+  data.default_engine = &controller_default_engine_s;
   data.default_path_setting = &controller_path_settings_s;
   data.default_path_setting_init = &controller_path_settings_init_s;
   data.default_path_pid = &controller_path_pid_s;
@@ -30,7 +31,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.default_path_socket_init = &controller_path_socket_init_s;
   data.default_path_socket_prefix = &controller_path_socket_prefix_s;
   data.default_path_socket_suffix = &controller_path_socket_suffix_s;
-  data.default_program_script = &controller_default_program_script_s;
   data.program_name = &controller_program_name_s;
   data.program_name_long = &controller_program_name_long_s;
 
index 301780b752d42e2e35e65c92feda8e629017f426..1ca1958117d0a01bd2d2a53a84b782afd368f840 100644 (file)
@@ -764,9 +764,9 @@ extern "C" {
     destination->timestamp.nanoseconds = source.timestamp.nanoseconds;
 
     destination->alias.used = 0;
+    destination->engine.used = 0;
     destination->name.used = 0;
     destination->path.used = 0;
-    destination->script.used = 0;
 
     destination->define.used = 0;
     destination->parameter.used = 0;
@@ -794,13 +794,13 @@ extern "C" {
     status = f_string_dynamic_append(source.alias, &destination->alias);
     if (F_status_is_error(status)) return status;
 
-    status = f_string_dynamic_append(source.name, &destination->name);
+    status = f_string_dynamic_append(source.engine, &destination->engine);
     if (F_status_is_error(status)) return status;
 
-    status = f_string_dynamic_append(source.path, &destination->path);
+    status = f_string_dynamic_append(source.name, &destination->name);
     if (F_status_is_error(status)) return status;
 
-    status = f_string_dynamic_append(source.script, &destination->script);
+    status = f_string_dynamic_append(source.path, &destination->path);
     if (F_status_is_error(status)) return status;
 
     status = f_string_maps_append_all(source.define, &destination->define);
@@ -1127,11 +1127,11 @@ extern "C" {
           }
 
           do {
-            if (process->rule.script.used) {
-              status = controller_rule_execute_foreground(process->rule.items.array[i].type, process->rule.script, arguments_none, options, &execute_set, process);
+            if (process->rule.engine.used) {
+              status = controller_rule_execute_foreground(process->rule.items.array[i].type, process->rule.engine, arguments_none, options, &execute_set, process);
             }
             else {
-              status = controller_rule_execute_foreground(process->rule.items.array[i].type, *global.main->default_program_script, arguments_none, options, &execute_set, process);
+              status = controller_rule_execute_foreground(process->rule.items.array[i].type, *global.main->default_engine, arguments_none, options, &execute_set, process);
             }
 
             if (status == F_child || F_status_set_fine(status) == F_lock) break;
@@ -1207,7 +1207,7 @@ extern "C" {
             }
 
             do {
-              status = controller_rule_execute_pid_with(process->rule.items.array[i].pid_file, process->rule.items.array[i].type, process->rule.script.used ? process->rule.script : *global.main->default_program_script, arguments_none, options, process->rule.items.array[i].with, &execute_set, process);
+              status = controller_rule_execute_pid_with(process->rule.items.array[i].pid_file, process->rule.items.array[i].type, process->rule.engine.used ? process->rule.engine : *global.main->default_engine, arguments_none, options, process->rule.items.array[i].with, &execute_set, process);
 
               if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break;
               if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break;
@@ -1365,7 +1365,7 @@ extern "C" {
         const f_string_statics_t simulated_arguments = f_string_statics_t_initialize;
         fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &f_string_empty_s);
 
-        status = fll_execute_program(*main->default_program_script, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result);
+        status = fll_execute_program(*main->default_engine, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result);
       }
     }
     else {
@@ -1622,7 +1622,7 @@ extern "C" {
         const f_string_statics_t simulated_arguments = f_string_statics_t_initialize;
         fl_execute_parameter_t simulated_parameter = macro_fl_execute_parameter_t_initialize(execute_set->parameter.option, execute_set->parameter.wait, process->rule.has & controller_rule_has_environment_d ? execute_set->parameter.environment : 0, execute_set->parameter.signals, &f_string_empty_s);
 
-        status = fll_execute_program(*main->default_program_script, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result);
+        status = fll_execute_program(*main->default_engine, simulated_arguments, &simulated_parameter, &execute_set->as, (void *) &result);
       }
     }
     else {
@@ -3496,9 +3496,9 @@ extern "C" {
     macro_f_time_spec_t_clear(rule->timestamp);
 
     rule->alias.used = 0;
+    rule->engine.used = 0;
     rule->name.used = 0;
     rule->path.used = 0;
-    rule->script.used = 0;
 
     rule->define.used = 0;
     rule->parameter.used = 0;
@@ -3817,6 +3817,9 @@ extern "C" {
       else if (fl_string_dynamic_compare(controller_define_s, cache->action.name_item) == F_equal_to) {
         type = controller_rule_setting_type_define_e;
       }
+      else if (fl_string_dynamic_compare(controller_engine_s, cache->action.name_item) == F_equal_to) {
+        type = controller_rule_setting_type_engine_e;
+      }
       else if (fl_string_dynamic_compare(controller_environment_s, cache->action.name_item) == F_equal_to) {
         type = controller_rule_setting_type_environment_e;
         empty_disallow = F_false;
@@ -3845,9 +3848,6 @@ extern "C" {
       else if (fl_string_dynamic_compare(controller_scheduler_s, cache->action.name_item) == F_equal_to) {
         type = controller_rule_setting_type_scheduler_e;
       }
-      else if (fl_string_dynamic_compare(controller_script_s, cache->action.name_item) == F_equal_to) {
-        type = controller_rule_setting_type_script_e;
-      }
       else if (fl_string_dynamic_compare(controller_timeout_s, cache->action.name_item) == F_equal_to) {
         type = controller_rule_setting_type_timeout_e;
       }
@@ -4410,7 +4410,7 @@ extern "C" {
         continue;
       }
 
-      if (type == controller_rule_setting_type_name_e || type == controller_rule_setting_type_path_e || type == controller_rule_setting_type_script_e) {
+      if (type == controller_rule_setting_type_name_e || type == controller_rule_setting_type_path_e || type == controller_rule_setting_type_engine_e) {
 
         if (type == controller_rule_setting_type_name_e) {
           setting_value = &rule->name;
@@ -4418,8 +4418,8 @@ extern "C" {
         else if (type == controller_rule_setting_type_path_e) {
           setting_value = &rule->path;
         }
-        else if (type == controller_rule_setting_type_script_e) {
-          setting_value = &rule->script;
+        else if (type == controller_rule_setting_type_engine_e) {
+          setting_value = &rule->engine;
         }
 
         if (setting_value->used || cache->content_actions.array[i].used != 1) {
@@ -4432,7 +4432,7 @@ extern "C" {
           continue;
         }
 
-        if (type == controller_rule_setting_type_name_e || type == controller_rule_setting_type_script_e) {
+        if (type == controller_rule_setting_type_name_e || type == controller_rule_setting_type_engine_e) {
           status = fl_string_dynamic_partial_rip_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value);
 
           if (F_status_is_error(status)) {
@@ -4505,7 +4505,7 @@ extern "C" {
             continue;
           }
 
-          controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_name_e ? controller_name_s : controller_script_s, f_string_empty_s, *setting_value, 0);
+          controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_name_e ? controller_name_s : controller_engine_s, f_string_empty_s, *setting_value, 0);
         }
         else if (type == controller_rule_setting_type_path_e) {
           status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value);
@@ -5613,8 +5613,8 @@ extern "C" {
 
     f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
 
-    // Script.
-    fl_print_format("  %[%r%] %Q%r", main->output.to.stream, main->context.set.important, controller_script_s, main->context.set.important, rule.script, f_string_eol_s);
+    // Engine.
+    fl_print_format("  %[%r%] %Q%r", main->output.to.stream, main->context.set.important, controller_engine_s, main->context.set.important, rule.engine, f_string_eol_s);
 
     // User.
     fl_print_format("  %[%r%]", main->output.to.stream, main->context.set.important, controller_user_s, main->context.set.important);
index a9287d0eef2368b3d412432b27dab7cdc74094bb..543933f4404e60ee28c6b57b12c932b27b6fc152 100644 (file)
@@ -85,7 +85,7 @@ extern "C" {
 
       controller_lock_print(print->to, (controller_thread_t *) process->main_thread);
 
-      fl_print_format("%r%[%QThe %r '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, script_is ? controller_script_s : controller_program_s, print->context);
+      fl_print_format("%r%[%QThe %r '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, script_is ? controller_engine_s : controller_program_s, print->context);
       fl_print_format("%[%Q%]", print->to.stream, print->notable, name, print->notable);
 
       if (status == F_control_group || status == F_limit || status == F_processor || status == F_schedule) {
index 1555c4331a762d42a0df7da272aeec3bfc654cfb..63c654fad82d5526199dfe4630d592baa90f1c81 100644 (file)
@@ -3,8 +3,8 @@
 _di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap).
 _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later).
 _controller_as_init_ Build the program to run as if it were "init" by default, including displaying the program name as "Init Program" or "Init". This changes the main.c file only, leaving the library shareable between both "controller" and "init".
-_override_controller_default_program_script_ Provide a custom script name string to execute (such as php).
-_override_controller_default_program_script_length_ The number of bytes representing the string in _override_controller_default_program_script_ (not including the terminating NULL).
+_override_controller_default_engine_ Provide a custom scripting engine name string to execute (such as php).
+_override_controller_default_engine_length_ The number of bytes representing the string in _override_controller_default_engine_ (not including the terminating NULL).
 _override_controller_path_pid_ Use this as the default custom directory path representing the location of the controller program pid.
 _override_controller_path_pid_init_ Provide a custom init path for the pid file rather than the default.
 _override_controller_path_pid_init_length_ The number of bytes representing the string in _override_controller_path_pid_init_ (not including the terminating NULL).
index 642e3e7603d720dd343bf33d69e3f85b0097f670..9b21b7a119c76c616694d4b4b6844ab851aa1291 100644 (file)
@@ -2,7 +2,7 @@
 
 setting:
   name "Environment default"
-  script bash
+  engine bash
 
 script:
   start {
index c1dba2e5c85f0cc52a8c1fa581982bdff94832f5..7305fa8084c7362a01688951d9a42bdfda2e8cf5 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "Environment set to nothing"
   environment
-  script bash
+  engine bash
 
 script:
   start {
index ede7d2d5039e03dcfbb7d968c05e3a2fb9ba70e4..66e5183e16d5bdba62e571e3d2ee91770e7d9793 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "Environment with PATH"
   environment PATH
-  script bash
+  engine bash
 
 script:
   start {
index 4353948f6d8014ed6b5e103ba9d86923472cb78b..d02cf22a794c2a42f862d3e37649d2f8e58b39dd 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "Environment with PATH"
   environment PATH custom_variable
-  script bash
+  engine bash
 
 script:
   start {
index 97b6fba79799fbd6ec087017066c3d5df250c831..170a27bc80c602d18b1cdea0e3cd17182bbd7c35 100644 (file)
@@ -2,7 +2,7 @@
 
 setting:
   name "Explosion!"
-  script sh
+  engine sh
 
 script:
   start {
index bf6c405924bc98ac2b6a3786ed228e8861189fb9..9b07be1cd3cdf499f83fca2c56372c22ec6f2b2e 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "PHP script"
   environment PATH
-  script php
+  engine php
 
 script:
   start {
index 57fabb2378fda0e6e78aac8fcf3687c1ff85ff21..6e6a22cca22ce1bf0b93c8234afed12e7df38b5b 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "Python (Version 3.X) script"
   environment PATH
-  script python3
+  engine python3
 
 script:
   start {
index 2cc1cc81ea7c81be79c1a08ad25281d7207ef746..afb8106e40f007b59311937269ef2f1bd95112e0 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "Example script for needs, wants, and wishes."
   environment PATH
-  script sh
+  engine sh
 
 script:
   start {
index be066b2caf4771ecc5d1b70f1c7ac11bab470f1f..5c88fc3d4c8b3188100a9c003173aae944d62a48 100644 (file)
@@ -3,7 +3,7 @@
 setting:
   name "Script #1"
   environment PATH
-  script sh
+  engine sh
 
 script:
   start {
index 9d4c53c96bc5b26108e8449ca6d95efe0ded791f..4c6040dae496268037a23213d86f0e4ea777c732 100644 (file)
@@ -16,6 +16,7 @@ Rule Documentation:
     - "capability": Define a set of capabilities in which to use, using the capability "text" format (such as "= cap_chown+ep").
     - "cgroup": Define a cgroup (control group) in which everything within this rule executes under.
     - "define": A single environment variable name and its associated value that is automatically exposed to processes executed within this rule.
+    - "engine": An executable name of a script, such as "bash", to use for the "script" Rule Type (which likely defaults to "bash" if not specified).
     - "environment": A set of environment variables to expose to the processes executed within this rule (PATH is always exposed).
     - "group": A set of group names or IDs to execute as with the first group being the primary group and all remaining being supplementary groups.
     - "limit": Define a resource limit to use (multiple limits may be specified, but only once for each type).
@@ -24,7 +25,6 @@ Rule Documentation:
     - "on": Define a Rule Action in which a specified dependency is needed, wanted, or wished for.
     - "parameter": An IKI name and its associated value for use in this rule file.
     - "path": A single Content used to set a custom PATH environment variable value.
-    - "script": An executable name of a script, such as "bash", to use for the "script" Rule Type (which likely defaults to "bash" if not specified).
     - "scheduler": A valid name of a scheduler to use followed by an optional priority number.
     - "timeout": A set of timeouts to wait for in which to perform a set action or to consider failure.
     - "user": A single user name or ID to execute as.
@@ -46,6 +46,10 @@ Rule Documentation:
     All environment variables, including those defined using this, must be in the "environment" list to be exported to the executed process.
     Environment variables added here that are not added to the environment are still exposed as an IKI variable.
 
+  - In the case of "engine"\:
+    This engine is used for both "script" and "utility" Rule Types.
+    The program that engine refers to must accept a standard input pipe to be supported.
+
   - In the case of "group" and "user"\:
     Only users and groups that the user the controller program is being run as is allowed to use may be used.
 
@@ -99,7 +103,7 @@ Rule Documentation:
 
   The "service" Rule Type provides a "command" accompanied with a PID file (Process Identifier file).
 
-  The "script" Rule Type provides a series of lines to be executed by a (Bash) script.
+  The "script" Rule Type provides a series of lines to be executed by some engine, such as GNU Bash.
   This "script" operates in the foreground, but individual things done within the script may operate in foreground or background.
   The last return state is treated as an error, so be sure to finish the script with a return code of 0 to designate no error and any other whole number, such a 1, to designate an error.
   Therefore passing "exit 1" would return as an error and passing "exit 0" would return as a success.
index 3de527df5f65c35f6b3ab097972bba73a987ea9b..b4b52d7473297c486227cc23311f461bbf429f99 100644 (file)
@@ -36,6 +36,7 @@ Rule Specification:
     - "capability": One Content representing capabilities.
     - "cgroup": Two or more Content, the first Content being either "existing" or "new" and the remaining representing a valid cgroup (control group) name, must have at least 1 graph character (non white space printing character) (leading and trailing white space are trimmed off).
     - "define": Two Content, the first Content must be a case-sensitive valid environment variable name (alpha-numeric or underscore, but no leading digits).
+    - "engine": One Content representing a valid program name or path (such as "bash" or "/bin/bash").
     - "environment": Zero or more Content, each must be a case-sensitive valid environment variable name (alpha-numeric or underscore, but no leading digits).
     - "group": One or more Content representing group names or group ids.
     - "limit": Three Content, with the first representing a valid resource type and the second and third being a valid resource limit number (positive whole number or 0).
@@ -45,7 +46,6 @@ Rule Specification:
     - "parameter": Two Content, the first Content must be a case-sensitive valid IKI name and the second being an IKI value.
     - "path": One Content representing a valid PATH environment string (such as "/bin:/sbin:/usr/bin").
     - "scheduler": One or Two Content representing a scheduler name and the optional numeric priority (Any whole number inclusively between 0 and 99).
-    - "script": One Content representing a valid program name or path (such as "bash" or "/bin/bash").
     - "user": One Content representing a user name or user id.
 
   The "command" and "script" Rule Types allow the following the FSS-0001 (Extended)\: