Tweak the fakefile structure.
Remove the "as_init" fakefile mode.
Use library instead of object so that both controller and init may use the same library.
I may want to create a custon "init only" mode where init uses libinit.so rather than libcontroller.so.
Have the build settings pass "-D_controller_as_init_" directly for the init fakefile.
Add the child process exit code.
I may end up changing this again, but I wanted to start off very consistent with other projects design.
Finish the help printing process.
The program name is moved into the specific programs.
Add missing control group header file include.
Fix a mistake whee the main thread signal function is calling itself rather than the main signal handler.
This bad behavior results in a segfault.
build settings.controller
build settings.init
-build_controller:
+main_controller:
build settings
build settings.controller
-build_init:
+main_init:
build settings
build settings.init
help:
print
- print context:'title'Fakefile Options for Controller Program.context:'reset'
+ print context:'title'Fakefile Options for the Controller and the Init Programs.context:'reset'
print
print The following operations are available\:
print " - context:'notable'help:context:'reset' Perform the help operation, printing this message."
- print " - context:'notable'build_controller:context:'reset' Compilation using the build settings mode for the controller program."
- print " - context:'notable'build_init:context:'reset' Compilation using the build settings mode for the init program."
- print " - context:'notable'install:context:'reset' A helper operation that simply calls the ./install.sh script with default settings."
- print " - context:'notable'install_controller:context:'reset' A helper operation that simply calls the ./install.sh script with default settings."
- print " - context:'notable'install_init:context:'reset' A helper operation that simply calls the ./install.sh script with default settings."
- print " - context:'notable'main:context:'reset' The default compilation using the build settings mode."
+ print " - context:'notable'install:context:'reset' A helper operation that calls the ./install.sh script for both the controller and init programs."
+ print " - context:'notable'install_controller:context:'reset' A helper operation that calls the ./install.sh script for the controller program."
+ print " - context:'notable'install_init:context:'reset' A helper operation that calls the ./install.sh script for the init program."
+ print " - context:'notable'main:context:'reset' Compilation using the build settings mode for both the controller and init programs (default)."
+ print " - context:'notable'main_controller:context:'reset' Compilation using the build settings mode for the controller program."
+ print " - context:'notable'main_init:context:'reset' Compilation using the build settings mode for the init program."
print
print The context:'notable'install context:'reset'operation supports the context:'notable'work,context:'reset' context:'notable'verbosity,context:'reset' and context:'notable'color context:'reset'parameters.
version_file micro
version_target minor
-modes individual individual_thread level monolithic clang gcc test fanalyzer coverage thread threadless as_init
+modes individual individual_thread level monolithic clang gcc test fanalyzer coverage thread threadless
modes_default monolithic thread gcc
build_compiler gcc
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_sources_object main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c
-build_sources_object main/print/data.c main/print/debug.c main/print/error.c main/print/message.c main/print/verbose.c main/print/warning.c
-build_sources_object main/signal.c main/thread.c
+build_sources_library main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c
+build_sources_library main/print/data.c main/print/debug.c main/print/error.c main/print/message.c main/print/verbose.c main/print/warning.c
+build_sources_library main/signal.c main/thread.c
build_sources_headers main/common.h main/controller.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h
build_sources_headers main/print/data.h main/print/debug.h main/print/error.h main/print/message.h main/print/verbose.h main/print/warning.h
defines -D_libcap_legacy_only_
defines-threadless -D_di_thread_support_
defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
-defines-as_init -D_controller_as_init_
flags -O2 -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
flags -fstack-clash-protection -fno-delete-null-pointer-checks
version_file micro
version_target minor
-modes individual individual_thread level monolithic clang gcc test fanalyzer coverage thread threadless as_init
+modes individual individual_thread level monolithic clang gcc test fanalyzer coverage thread threadless
modes_default monolithic thread gcc
build_compiler gcc
build_indexer_arguments rcs
build_language c
-build_libraries -lc -lcap
+build_libraries -lc -lcap -lcontroller
build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_print -lfll_program -lfll_status_string
build_libraries-individual_thread -lf_thread
build_libraries-individual -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_path -lfl_print
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_objects_library main/common.o main/common/define.o main/common/enumeration.o main/common/print.o main/common/string.o main/common/type.o
-build_objects_library main/print/data.o main/print/debug.o main/print/error.o main/print/message.o main/print/verbose.o main/print/warning.o
-build_objects_library main/signal.o main/thread.o
+build_sources_program controller/config.c controller/main.c controller/controller.c controller/string.c
-build_sources_library controller/controller.c
-
-build_sources_program controller/config.c controller/main.c
-
-build_sources_headers controller/controller.h
+build_sources_headers controller/controller.h controller/string.h
build_sources_documentation man
defines -D_libcap_legacy_only_
defines-threadless -D_di_thread_support_
defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
-defines-as_init -D_controller_as_init_
flags -O2 -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
flags -fstack-clash-protection -fno-delete-null-pointer-checks
version_file micro
version_target minor
-modes individual individual_thread level monolithic clang gcc test fanalyzer coverage thread threadless as_init
+modes individual individual_thread level monolithic clang gcc test fanalyzer coverage thread threadless
modes_default monolithic thread gcc
build_compiler gcc
build_indexer_arguments rcs
build_language c
-build_libraries -lc -lcap
+build_libraries -lc -lcap -lcontroller
build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_print -lfll_program -lfll_status_string
build_libraries-individual_thread -lf_thread
build_libraries-individual -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_path -lfl_print
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_objects_library main/common.o main/common/define.o main/common/enumeration.o main/common/print.o main/common/string.o main/common/type.o
-build_objects_library main/print/data.o main/print/debug.o main/print/error.o main/print/message.o main/print/verbose.o main/print/warning.o
-build_objects_library main/signal.o main/thread.o
+build_sources_program init/config.c init/main.c init/init.c init/string.c
-build_sources_library init/init.c
-
-build_sources_program init/config.c init/main.c
-
-build_sources_headers init/init.h
+build_sources_headers init/init.h init/string.h
build_sources_documentation man
environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH
#defines -D_di_libcap_
-defines -D_libcap_legacy_only_
+defines -D_controller_as_init_ -D_libcap_legacy_only_
defines-threadless -D_di_thread_support_
defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
-defines-as_init -D_controller_as_init_
flags -O2 -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
flags -fstack-clash-protection -fno-delete-null-pointer-checks
if (main->setting.flag & controller_main_flag_version_copyright_help_e) {
if (main->setting.flag & controller_main_flag_help_e) {
- controller_main_print_message_help(&main->program.message);
+ controller_main_print_message_help(&main->program.message, F_false);
}
else if (main->setting.flag & controller_main_flag_version_e) {
fll_program_print_version(&main->program.message, controller_program_version_s);
#include <program/controller/main/print/warning.h>
#include <program/controller/main/signal.h>
#include <program/controller/main/thread.h>
+#include <program/controller/controller/string.h>
#ifdef __cplusplus
extern "C" {
data.program.output.custom = (void *) &data;
data.program.warning.custom = (void *) &data;
- data.setting.program_name = &controller_program_name_s;
- data.setting.program_name_long = &controller_program_name_long_s;
+ data.setting.program_name = &controller_controller_program_name_s;
+ data.setting.program_name_long = &controller_controller_program_name_long_s;
f_console_parameter_t parameters[] = controller_console_parameter_t_initialize;
fll_program_standard_set_down(&data.program);
+ if (data.setting.state.status == F_child) {
+ exit(data.program.child);
+ }
+
return (F_status_is_error(data.setting.state.status) || data.setting.state.status == F_false) ? 1 : 0;
}
--- /dev/null
+#include "controller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_controller_controller_program_name_s_
+ const f_string_static_t controller_controller_program_name_s = macro_f_string_static_t_initialize_1(CONTROLLER_controller_program_name_s, 0, CONTROLLER_controller_program_name_s_length);
+ const f_string_static_t controller_controller_program_name_long_s = macro_f_string_static_t_initialize_1(CONTROLLER_controller_program_name_long_s, 0, CONTROLLER_controller_program_name_long_s_length);
+#endif // _di_controller_controller_program_name_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common string structures for the controller program.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _controller_controller_string_h
+#define _controller_controller_string_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The program name.
+ */
+#ifndef _di_controller_controller_program_name_s_
+ #define CONTROLLER_controller_program_name_s "controller"
+ #define CONTROLLER_controller_program_name_long_s "Controller"
+
+ #define CONTROLLER_controller_program_name_s_length 10
+ #define CONTROLLER_controller_program_name_long_s_length 10
+
+ extern const f_string_static_t controller_controller_program_name_s;
+ extern const f_string_static_t controller_controller_program_name_long_s;
+#endif // _di_controller_controller_program_name_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_controller_string_h
if (main->setting.flag & controller_main_flag_version_copyright_help_e) {
if (main->setting.flag & controller_main_flag_help_e) {
- controller_main_print_message_help(&main->program.message);
+ controller_main_print_message_help(&main->program.message, F_true);
}
else if (main->setting.flag & controller_main_flag_version_e) {
fll_program_print_version(&main->program.message, controller_program_version_s);
#include <program/controller/main/print/warning.h>
#include <program/controller/main/signal.h>
#include <program/controller/main/thread.h>
+#include <program/controller/init/string.h>
#ifdef __cplusplus
extern "C" {
data.program.output.custom = (void *) &data;
data.program.warning.custom = (void *) &data;
- data.setting.program_name = &controller_program_name_s;
- data.setting.program_name_long = &controller_program_name_long_s;
+ data.setting.program_name = &controller_init_program_name_s;
+ data.setting.program_name_long = &controller_init_program_name_long_s;
f_console_parameter_t parameters[] = controller_console_parameter_t_initialize;
fll_program_standard_set_down(&data.program);
+ if (data.setting.state.status == F_child) {
+ exit(data.program.child);
+ }
+
return (F_status_is_error(data.setting.state.status) || data.setting.state.status == F_false) ? 1 : 0;
}
--- /dev/null
+#include "init.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_controller_init_program_name_s_
+ const f_string_static_t controller_init_program_name_s = macro_f_string_static_t_initialize_1(CONTROLLER_init_program_name_s, 0, CONTROLLER_init_program_name_s_length);
+ const f_string_static_t controller_init_program_name_long_s = macro_f_string_static_t_initialize_1(CONTROLLER_init_program_name_long_s, 0, CONTROLLER_init_program_name_long_s_length);
+#endif // _di_controller_init_program_name_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common string structures for the init program.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _controller_init_string_h
+#define _controller_init_string_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The program name.
+ */
+#ifndef _di_controller_init_program_name_s_
+ #define CONTROLLER_init_program_name_s "init"
+ #define CONTROLLER_init_program_name_long_s "Init"
+
+ #define CONTROLLER_init_program_name_s_length 4
+ #define CONTROLLER_init_program_name_long_s_length 4
+
+ extern const f_string_static_t controller_init_program_name_s;
+ extern const f_string_static_t controller_init_program_name_long_s;
+#endif // _di_controller_init_program_name_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_init_string_h
{ \
macro_fll_program_console_parameter_standard_initialize, \
\
- macro_f_console_parameter_t_initialize_3(controller_short_controller_s, controller_long_controller_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_cgroup_s, controller_long_cgroup_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_daemon_s, controller_long_daemon_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_init_s, controller_long_init_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_interruptible_s, controller_long_interruptible_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_pid_s, controller_long_pid_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_settings_s, controller_long_settings_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_simulate_s, controller_long_simulate_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_socket_s, controller_long_socket_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_uninterruptible_s, controller_long_uninterruptible_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(controller_short_validate_s, controller_long_validate_s, 0, f_console_flag_normal_e), \
}
- #define controller_parameter_total_d (f_console_parameter_state_type_total_d + 1)
+ #define controller_parameter_total_d (f_console_parameter_state_type_total_d + 10)
#endif // _di_controller_parameter_e_
/**
const f_string_static_t controller_program_version_s = macro_f_string_static_t_initialize_1(CONTROLLER_program_version_s, 0, CONTROLLER_program_version_s_length);
#endif // _di_controller_program_version_s_
-#ifndef _di_controller_program_name_s_
- const f_string_static_t controller_program_name_s = macro_f_string_static_t_initialize_1(CONTROLLER_program_name_s, 0, CONTROLLER_program_name_s_length);
- const f_string_static_t controller_program_name_long_s = macro_f_string_static_t_initialize_1(CONTROLLER_program_name_long_s, 0, CONTROLLER_program_name_long_s_length);
-#endif // _di_controller_program_name_s_
-
#ifndef _di_controller_parameter_s_
- const f_string_static_t controller_short_controller_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_controller_s, 0, CONTROLLER_short_controller_s_length);
+ const f_string_static_t controller_short_cgroup_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_cgroup_s, 0, CONTROLLER_short_cgroup_s_length);
+ const f_string_static_t controller_short_daemon_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_daemon_s, 0, CONTROLLER_short_daemon_s_length);
+ const f_string_static_t controller_short_init_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_init_s, 0, CONTROLLER_short_init_s_length);
+ const f_string_static_t controller_short_interruptible_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_interruptible_s, 0, CONTROLLER_short_interruptible_s_length);
+ const f_string_static_t controller_short_pid_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_pid_s, 0, CONTROLLER_short_pid_s_length);
+ const f_string_static_t controller_short_settings_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_settings_s, 0, CONTROLLER_short_settings_s_length);
+ const f_string_static_t controller_short_simulate_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_simulate_s, 0, CONTROLLER_short_simulate_s_length);
+ const f_string_static_t controller_short_socket_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_socket_s, 0, CONTROLLER_short_socket_s_length);
+ const f_string_static_t controller_short_uninterruptible_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_uninterruptible_s, 0, CONTROLLER_short_uninterruptible_s_length);
+ const f_string_static_t controller_short_validate_s = macro_f_string_static_t_initialize_1(CONTROLLER_short_validate_s, 0, CONTROLLER_short_validate_s_length);
- const f_string_static_t controller_long_controller_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_controller_s, 0, CONTROLLER_long_controller_s_length);
+ const f_string_static_t controller_long_cgroup_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_cgroup_s, 0, CONTROLLER_long_cgroup_s_length);
+ const f_string_static_t controller_long_daemon_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_daemon_s, 0, CONTROLLER_long_daemon_s_length);
+ const f_string_static_t controller_long_init_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_init_s, 0, CONTROLLER_long_init_s_length);
+ const f_string_static_t controller_long_interruptible_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_interruptible_s, 0, CONTROLLER_long_interruptible_s_length);
+ const f_string_static_t controller_long_pid_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_pid_s, 0, CONTROLLER_long_pid_s_length);
+ const f_string_static_t controller_long_settings_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_settings_s, 0, CONTROLLER_long_settings_s_length);
+ const f_string_static_t controller_long_simulate_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_simulate_s, 0, CONTROLLER_long_simulate_s_length);
+ const f_string_static_t controller_long_socket_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_socket_s, 0, CONTROLLER_long_socket_s_length);
+ const f_string_static_t controller_long_uninterruptible_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_uninterruptible_s, 0, CONTROLLER_long_uninterruptible_s_length);
+ const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize_1(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length);
#endif // _di_controller_parameter_s_
#ifdef __cplusplus
#endif // _di_controller_program_version_s_
/**
- * The program name.
- */
-#ifndef _di_controller_program_name_s_
- #define CONTROLLER_program_name_s "controller"
- #define CONTROLLER_program_name_long_s "Controller"
-
- #define CONTROLLER_program_name_s_length 10
- #define CONTROLLER_program_name_long_s_length 10
-
- extern const f_string_static_t controller_program_name_s;
- extern const f_string_static_t controller_program_name_long_s;
-#endif // _di_controller_program_name_s_
-
-/**
* The main program parameters.
*/
#ifndef _di_controller_parameter_s_
- #define CONTROLLER_short_controller_s "e"
-
- #define CONTROLLER_long_controller_s "controller"
-
- #define CONTROLLER_short_controller_s_length 1
-
- #define CONTROLLER_long_controller_s_length 7
-
- extern const f_string_static_t controller_short_controller_s;
-
- extern const f_string_static_t controller_long_controller_s;
+ #define CONTROLLER_short_cgroup_s "c"
+ #define CONTROLLER_short_daemon_s "d"
+ #define CONTROLLER_short_init_s "I"
+ #define CONTROLLER_short_interruptible_s "i"
+ #define CONTROLLER_short_pid_s "p"
+ #define CONTROLLER_short_settings_s "s"
+ #define CONTROLLER_short_simulate_s "S"
+ #define CONTROLLER_short_socket_s "k"
+ #define CONTROLLER_short_uninterruptible_s "U"
+ #define CONTROLLER_short_validate_s "v"
+
+ #define CONTROLLER_long_cgroup_s "cgroup"
+ #define CONTROLLER_long_daemon_s "daemon"
+ #define CONTROLLER_long_init_s "init"
+ #define CONTROLLER_long_interruptible_s "interruptible"
+ #define CONTROLLER_long_pid_s "pid"
+ #define CONTROLLER_long_settings_s "settings"
+ #define CONTROLLER_long_simulate_s "simulate"
+ #define CONTROLLER_long_socket_s "socket"
+ #define CONTROLLER_long_uninterruptible_s "uninterruptible"
+ #define CONTROLLER_long_validate_s "validate"
+
+ #define CONTROLLER_short_cgroup_s_length 1
+ #define CONTROLLER_short_daemon_s_length 1
+ #define CONTROLLER_short_init_s_length 1
+ #define CONTROLLER_short_interruptible_s_length 1
+ #define CONTROLLER_short_pid_s_length 1
+ #define CONTROLLER_short_settings_s_length 1
+ #define CONTROLLER_short_simulate_s_length 1
+ #define CONTROLLER_short_socket_s_length 1
+ #define CONTROLLER_short_uninterruptible_s_length 1
+ #define CONTROLLER_short_validate_s_length 1
+
+ #define CONTROLLER_long_cgroup_s_length 6
+ #define CONTROLLER_long_daemon_s_length 6
+ #define CONTROLLER_long_init_s_length 4
+ #define CONTROLLER_long_interruptible_s_length 13
+ #define CONTROLLER_long_pid_s_length 3
+ #define CONTROLLER_long_settings_s_length 8
+ #define CONTROLLER_long_simulate_s_length 8
+ #define CONTROLLER_long_socket_s_length 6
+ #define CONTROLLER_long_uninterruptible_s_length 15
+ #define CONTROLLER_long_validate_s_length 8
+
+ extern const f_string_static_t controller_short_cgroup_s;
+ extern const f_string_static_t controller_short_daemon_s;
+ extern const f_string_static_t controller_short_init_s;
+ extern const f_string_static_t controller_short_interruptible_s;
+ extern const f_string_static_t controller_short_pid_s;
+ extern const f_string_static_t controller_short_settings_s;
+ extern const f_string_static_t controller_short_simulate_s;
+ extern const f_string_static_t controller_short_socket_s;
+ extern const f_string_static_t controller_short_uninterruptible_s;
+ extern const f_string_static_t controller_short_validate_s;
+
+ extern const f_string_static_t controller_long_cgroup_s;
+ extern const f_string_static_t controller_long_daemon_s;
+ extern const f_string_static_t controller_long_init_s;
+ extern const f_string_static_t controller_long_interruptible_s;
+ extern const f_string_static_t controller_long_pid_s;
+ extern const f_string_static_t controller_long_settings_s;
+ extern const f_string_static_t controller_long_simulate_s;
+ extern const f_string_static_t controller_long_socket_s;
+ extern const f_string_static_t controller_long_uninterruptible_s;
+ extern const f_string_static_t controller_long_validate_s;
#endif // _di_controller_parameter_s_
#ifdef __cplusplus
*
* status_signal: A status used eclusively by the threaded signal handler.
* state: The state data used when processing the FSS data.
+ *
+ * program_name: The short program name.
+ * program_name_long: The long program name.
*/
#ifndef _di_controller_setting_t_
typedef struct {
#include <fll/level_0/utf.h>
#include <fll/level_0/color.h>
#include <fll/level_0/compare.h>
+#include <fll/level_0/control_group.h>
#include <fll/level_0/console.h>
#include <fll/level_0/conversion.h>
#include <fll/level_0/pipe.h>
#endif
#ifndef _di_controller_main_print_message_help_
- f_status_t controller_main_print_message_help(fl_print_t * const print) {
+ f_status_t controller_main_print_message_help(fl_print_t * const print, const uint8_t uninterrupt) {
- if (!print) return F_status_set_error(F_output_not);
+ if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+ controller_main_t * const main = (controller_main_t *) print->custom;
f_file_stream_lock(print->to);
- fll_program_print_help_header(print, controller_program_name_long_s, controller_program_version_s);
+ fll_program_print_help_header(print, *main->setting.program_name_long, controller_program_version_s);
fll_program_print_help_option_standard(print);
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(print, controller_short_controller_s, controller_long_controller_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "This is an controller program parameter.");
+ fll_program_print_help_option(print, controller_short_cgroup_s, controller_long_cgroup_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom control group file path, such as '" F_control_group_path_system_prefix_s F_control_group_path_system_default_s "'.");
+ fll_program_print_help_option(print, controller_short_daemon_s, controller_long_daemon_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Run in daemon only mode (do not process the entry).");
+ fll_program_print_help_option(print, controller_short_init_s, controller_long_init_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The program will run as an init replacement.");
+ fll_program_print_help_option(print, controller_short_interruptible_s, controller_long_interruptible_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Designate that this program can be interrupted by a signal.");
+ fll_program_print_help_option(print, controller_short_pid_s, controller_long_pid_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom pid file path, such as 'controller/run/default.pid'.");
+ fll_program_print_help_option(print, controller_short_settings_s, controller_long_settings_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom settings path, such as 'controller/'.");
+ fll_program_print_help_option(print, controller_short_simulate_s, controller_long_simulate_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Run as a simulation.");
+ fll_program_print_help_option(print, controller_short_socket_s, controller_long_socket_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom socket file path, such as 'controller/run/default.socket'.");
+ fll_program_print_help_option(print, controller_short_uninterruptible_s, controller_long_uninterruptible_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Designate that this program cannot be interrupted by a signal.");
+ fll_program_print_help_option(print, controller_short_validate_s, controller_long_validate_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Validate the settings (entry and rules) without running (does not simulate).");
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_usage(print, controller_program_name_s, f_string_empty_s);
+ fll_program_print_help_usage(print, *main->setting.program_name, f_string_empty_s);
+
+ fl_print_format("%r When both the %[%r%r%] parameter and the", print->to, f_string_eol_s, print->set->notable, f_console_symbol_long_normal_s, controller_long_simulate_s, print->set->notable);
+ fl_print_format(" %[%r%r%] parameter are specified, then additional information on each would be executed rule is printed but no simulation is performed.%r%r", print->to, print->set->notable, f_console_symbol_long_normal_s, controller_long_validate_s, print->set->notable, f_string_eol_s, f_string_eol_s);
+
+ fl_print_format(" The default interrupt behavior is to operate as if the %[%r%r%] parameter is passed.%r%r", print->to, print->set->notable, f_console_symbol_long_normal_s, uninterrupt ? controller_long_uninterruptible_s : controller_long_interruptible_s, print->set->notable, f_string_eol_s, f_string_eol_s);
+
+ fl_print_format(" Specify an empty string for the %[%r%r%] parameter to disable pid file creation for this program.%r", print->to, print->set->notable, f_console_symbol_long_normal_s, controller_long_pid_s, print->set->notable, f_string_eol_s);
f_file_stream_flush(print->to);
f_file_stream_unlock(print->to);
* This requires print.custom to be controller_main_t.
*
* This does not alter print.custom.setting.state.status.
+ * @param uninterrupt
+ * Set to F_true to print that the default behavior is uninterruptible.
+ * Otherwise, print that the default behavior is interruptible.
*
* @return
* F_okay on success.
* @see fll_program_print_help_usage()
*/
#ifndef _di_controller_main_print_message_help_
- extern f_status_t controller_main_print_message_help(fl_print_t * const print);
+ extern f_status_t controller_main_print_message_help(fl_print_t * const print, const uint8_t uninterrupt);
#endif // _di_controller_main_print_message_help_
#ifdef __cplusplus
f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0);
if (main) {
- controller_main_thread_signal((controller_main_t *) main);
+ controller_main_signal_handler((controller_main_t *) main);
}
return 0;