f_print_character(f_string_eol_s[0], main.output.stream);
- fll_program_print_help_option(main.output, main.context, controller_short_control, controller_long_control, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom control group file path, such as '" f_control_group_path_system_prefix f_control_group_path_system_default "'.");
- fll_program_print_help_option(main.output, main.context, controller_short_daemon, controller_long_daemon, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run in daemon only mode (do not process the entry).");
- fll_program_print_help_option(main.output, main.context, controller_short_init, controller_long_init, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The program will run as an init replacement.");
- fll_program_print_help_option(main.output, main.context, controller_short_interruptable, controller_long_interruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Designate that this program can be interrupted.");
- fll_program_print_help_option(main.output, main.context, controller_short_pid, controller_long_pid, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom pid file path, such as '" controller_path_pid controller_string_default controller_path_suffix "'.");
- fll_program_print_help_option(main.output, main.context, controller_short_settings, controller_long_settings, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom settings path, such as '" controller_path_settings "'.");
- fll_program_print_help_option(main.output, main.context, controller_short_simulate, controller_long_simulate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run as a simulation.");
- fll_program_print_help_option(main.output, main.context, controller_short_validate, controller_long_validate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Validate the settings (entry and rules) without running (does not simulate).");
+ fll_program_print_help_option(main.output, main.context, controller_short_control, controller_long_control, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom control group file path, such as '" f_control_group_path_system_prefix f_control_group_path_system_default "'.");
+ fll_program_print_help_option(main.output, main.context, controller_short_daemon, controller_long_daemon, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run in daemon only mode (do not process the entry).");
+ fll_program_print_help_option(main.output, main.context, controller_short_init, controller_long_init, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The program will run as an init replacement.");
+ fll_program_print_help_option(main.output, main.context, controller_short_interruptable, controller_long_interruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate that this program can be interrupted by a signal.");
+ fll_program_print_help_option(main.output, main.context, controller_short_pid, controller_long_pid, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom pid file path, such as '" controller_path_pid controller_string_default controller_path_suffix "'.");
+ fll_program_print_help_option(main.output, main.context, controller_short_settings, controller_long_settings, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom settings path, such as '" controller_path_settings "'.");
+ fll_program_print_help_option(main.output, main.context, controller_short_simulate, controller_long_simulate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run as a simulation.");
+ fll_program_print_help_option(main.output, main.context, controller_short_uninterruptable, controller_long_uninterruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Designate that this program cannot be interrupted by a signal.");
+ fll_program_print_help_option(main.output, main.context, controller_short_validate, controller_long_validate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Validate the settings (entry and rules) without running (does not simulate).");
fll_program_print_help_usage(main.output, main.context, main.program_name, "entry");
fl_print_format(" When both the %[%s%s%] parameter and the", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_simulate, main.context.set.notable);
fl_print_format(" %[%s%s%] parameter are specified, then additional information on each would be executed rule is printed but no simulation is performed.%c%c", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_validate, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]);
+ fl_print_format(" The default interrupt behavior is to operate as if the %[%s%s%] parameter is passed.%c%c", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, main.setting_default.used ? controller_long_uninterruptable : controller_long_interruptable, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]);
+
funlockfile(main.output.stream);
return F_none;
}
}
+ // when a default setting is not provided, then make the program interruptable by default.
+ if (main->setting_default.used) {
+ if (main->parameters[controller_parameter_interruptable].result == f_console_result_found) {
+ setting.interruptable = F_true;
+ }
+ }
+ else {
+ if (main->parameters[controller_parameter_uninterruptable].result == f_console_result_none) {
+ setting.interruptable = F_true;
+ }
+ }
+
if (F_status_is_error_not(status)) {
f_signal_set_fill(&main->signal.set);
#define controller_path_settings_length 10
#define controller_path_suffix_length 4
- #define controller_short_control "c"
- #define controller_short_daemon "d"
- #define controller_short_init "I"
- #define controller_short_interruptable "i"
- #define controller_short_pid "p"
- #define controller_short_settings "s"
- #define controller_short_simulate "S"
- #define controller_short_validate "v"
-
- #define controller_long_control "control"
- #define controller_long_daemon "daemon"
- #define controller_long_init "init"
- #define controller_long_interruptable "interruptable"
- #define controller_long_pid "pid"
- #define controller_long_settings "settings"
- #define controller_long_simulate "simulate"
- #define controller_long_validate "validate"
+ #define controller_short_control "c"
+ #define controller_short_daemon "d"
+ #define controller_short_init "I"
+ #define controller_short_interruptable "i"
+ #define controller_short_pid "p"
+ #define controller_short_settings "s"
+ #define controller_short_simulate "S"
+ #define controller_short_uninterruptable "U"
+ #define controller_short_validate "v"
+
+ #define controller_long_control "control"
+ #define controller_long_daemon "daemon"
+ #define controller_long_init "init"
+ #define controller_long_interruptable "interruptable"
+ #define controller_long_pid "pid"
+ #define controller_long_settings "settings"
+ #define controller_long_simulate "simulate"
+ #define controller_long_uninterruptable "uninterruptable"
+ #define controller_long_validate "validate"
enum {
controller_parameter_help,
controller_parameter_pid,
controller_parameter_settings,
controller_parameter_simulate,
+ controller_parameter_uninterruptable,
controller_parameter_validate,
};
f_console_parameter_t_initialize(controller_short_pid, controller_long_pid, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(controller_short_settings, controller_long_settings, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(controller_short_simulate, controller_long_simulate, 0, 0, f_console_type_normal), \
+ f_console_parameter_t_initialize(controller_short_uninterruptable, controller_long_uninterruptable, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(controller_short_validate, controller_long_validate, 0, 0, f_console_type_normal), \
}
- #define controller_total_parameters 17
+ #define controller_total_parameters 18
#endif // _di_controller_defines_
#ifndef _di_controller_main_t_