As expected, I have found several regressions as a result of the mass conversion to fl_print_format() and similar.
There are several places where the wrong parameters or string replacements are used.
Improve the Controller to allow for "Init" to not attempt to mount the pid file (which allows Init to also manage initial mounting and device creation without depending on the existence of the filesystem structure).
The Controllerr "Init" now treats an empty string for the --pid option as disabling the pid file creation.
Do not treat exiting as a result from interrupts as an exit error.
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]);
+ fl_print_format(" Specify an empty string for the %[%s%s%] parameter to disable pid file creation for this program.%c%c", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_pid, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]);
+
funlockfile(main.output.stream);
return F_none;
}
}
else {
- if (main->warning.verbosity == f_console_verbosity_debug) {
- flockfile(main->warning.to.stream);
-
- fl_print_format("%c%[%SThe parameter '%]", main->warning.to.stream, f_string_eol_s[0], main->warning.context, main->warning.prefix ? main->warning.prefix : f_string_empty_s, main->warning.context);
- fl_print_format("%[%s%s%]", main->warning.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, controller_long_pid, main->context.set.notable);
- fl_print_format("%[' must be a file path but instead is an empty string, falling back to the default.%]%c", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s[0]);
-
- funlockfile(main->warning.to.stream);
- }
+ main->process_pid = F_false;
}
}
}
- // a pid file path is required.
- if (F_status_is_error_not(status) && !setting.path_pid.used) {
+ if (F_status_is_error_not(status) && !setting.path_pid.used && main->process_pid) {
if (main->parameters[controller_parameter_init].result == f_console_result_found) {
status = f_string_append(controller_path_pid_init, controller_path_pid_init_length, &setting.path_pid);
f_array_lengths_t remaining;
bool process_pipe;
+ bool process_pid;
f_file_t output;
fll_error_print_t error;
controller_console_parameter_t_initialize, \
f_array_lengths_t_initialize, \
F_false, \
+ F_true, \
macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
macro_fll_error_print_t_initialize_warning(), \
// when run as "init" by default, provide the default system-level init path.
// this change must only exist within this main file so that the change only exists within the program rather than the library.
#ifdef _controller_as_init_
+ data.process_pid = F_false;
data.program_name = controller_name_init;
data.program_name_long = controller_name_init_long;
data.setting_default.string = controller_path_settings_init;
}
if (F_status_is_error(status)) {
- return 1;
+
+ // do not return error when interrupt was received.
+ if (F_status_set_fine(status) != F_interrupt) {
+ return 1;
+ }
}
return 0;
fl_print_format(" %['due to%] ", print.to.stream, print.context, print.context);
if (status == F_parameter) {
- fl_print_format("%[%s%]", print.to.stream, print.notable, "Invalid Parameter", print.notable);
+ fl_print_format("%[Invalid Parameter%]", print.to.stream, print.notable, print.notable);
}
else if (status == F_deadlock) {
- fl_print_format("%[%s%]", print.to.stream, print.notable, "Deadlock", print.notable);
+ fl_print_format("%[Deadlock%]", print.to.stream, print.notable, print.notable);
}
else if (status == F_resource_not) {
- fl_print_format("%[%s%]", print.to.stream, print.notable, "Too Many Locks", print.notable);
+ fl_print_format("%[Too Many Locks%]", print.to.stream, print.notable, print.notable);
}
else {
- fl_print_format("%[%s%]", print.to.stream, print.notable, "Unknown Error", print.notable);
+ fl_print_format("%[Unknown Error%]", print.to.stream, print.notable, print.notable);
}
}
f_status_t status = F_none;
// only create pid file when not in validate mode.
- if (is_entry && global.main->parameters[controller_parameter_validate].result == f_console_result_none) {
+ if (is_entry && global.main->parameters[controller_parameter_validate].result == f_console_result_none && global.main->process_pid) {
status = controller_file_pid_create(global.main->pid, global.setting->path_pid);
fl_print_format("%c%[%SThe %s item named '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, entry->items.array[i].name, global.main->error.notable);
- fl_print_format("%[' cannot be executed because recursion is not allowed.%]%c", global.main->error.to.stream, global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
+ fl_print_format("%[' cannot be executed because recursion is not allowed.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
fl_print_format("%c%[%SThe %s item named '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->error.notable);
- fl_print_format("%[' does not exist.%]%c", global.main->error.to.stream, global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.context, f_string_eol_s[0]);
+ fl_print_format("%[' does not exist.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
flockfile(output->to.stream);
- fl_print_format("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_format("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->context, output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, output->context);
fl_print_format("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (entry_action->parameters.used) {
flockfile(output->to.stream);
- fl_print_format("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
+ fl_print_format("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->context, output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, output->context);
fl_print_format("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (entry_action->parameters.used) {
fl_print_format("%c%[%SExecution failed, unable to find program or script '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
fl_print_format("%[%Q%]", global->main->error.to.stream, global->main->error.notable, entry_action->parameters.array[0], global->main->error.notable);
- fl_print_format("$['.%]%c", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s[0]);
+ fl_print_format("%['.%]%c", global->main->error.to.stream, global->main->error.context, global->main->error.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
if (cache.name_action.used) {
fl_print_format("action '%]", output.to.stream, output.context);
- fl_print_format("%[%Q%]", output.to.stream, output.context, cache.name_action, output.context);
+ fl_print_format("%[%Q%]", output.to.stream, output.notable, cache.name_action, output.notable);
fl_print_format("%[' on line%] ", output.to.stream, output.context, output.context);
fl_print_format("%[%un%]", output.to.stream, output.notable, cache.line_action, output.notable);
fl_print_format("%[ for ", output.to.stream, output.context);
controller_error_print(global.main->error, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread);
}
else {
-
actions->array[actions->used].type = type;
actions->array[actions->used].line += ++item->line;
actions->array[actions->used].parameters.used = 0;
fl_print_format("%c%[%SWhile processing ", output.to.stream, f_string_eol_s[0], output.context, output.prefix);
if (cache.name_action.used) {
- fl_print_format("%s '%]", output.to.stream, output.context, item ? controller_string_action_s : controller_string_value_s, output.context);
+ fl_print_format("%s '%]", output.to.stream, item ? controller_string_action_s : controller_string_value_s, output.context);
fl_print_format("%[%Q%]", output.to.stream, output.notable, cache.name_action, output.notable);
- fl_print_format("%[ on line %]", output.to.stream, output.context, output.context);
+ fl_print_format("%[' on line%] ", output.to.stream, output.context, output.context);
fl_print_format("%[%un%]", output.to.stream, output.notable, cache.line_action, output.notable);
fl_print_format("%[ for ", output.to.stream, output.context);
}
if (cache.name_item.used) {
- fl_print_format("rule %s '%]", output.to.stream, output.context, item ? controller_string_item_s : controller_string_setting_s, output.context);
+ fl_print_format("rule %s '%]", output.to.stream, item ? controller_string_item_s : controller_string_setting_s, output.context);
fl_print_format("%[%Q%]", output.to.stream, output.notable, cache.name_item, output.notable);
- fl_print_format("%[ on line %]", output.to.stream, output.context, output.context);
+ fl_print_format("%[' on line%] ", output.to.stream, output.context, output.context);
fl_print_format("%[%un%]", output.to.stream, output.notable, cache.line_item, output.notable);
fl_print_format("%[ for ", output.to.stream, output.context);
}
}
else {
for (k = 0; k < action->parameters.used; ++k) {
- fl_print_format(" %s%s%s %Q%c", main->output.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s[0]);
+ fl_print_format(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s[0]);
} // for
}
boot:
start boot filesystem require
start boot modules require
- start boot devices require
start service logger wait
start service dbus asynchronous
start service mouse
maintenance:
- timeout start 2
- timeout stop 2
- timeout kill 2
-
- start maintenance console
+ execute bash --login
--- /dev/null
+# fss-0005
+#
+# A boot to bash process.
+#
+
+main:
+ execute bash --login
+++ /dev/null
-# fss-000d
-#
-# Rule for initializing the device files.
-#
-
-setting:
- name "Setup System Devices"
-
- on start need boot modules
#
# Rule for the terminal programs.
#
+# -m = don't prompt for login.
setting:
name "System Terminal"
capability "all="
-service:
- pid_file /var/run/tty/tty1.pid
+command:
+ #pid_file /var/run/tty/tty1.pid
- start qingy tty1 -d -l -n -t
+ start agetty -8 9600 tty1 linux
-service:
- pid_file /var/run/tty/tty2.pid
+command:
+ #pid_file /var/run/tty/tty2.pid
- start qingy tty2 -d -l -n -t
+ start agetty -8 9600 tty2 linux
-service:
- pid_file /var/run/tty/tty3.pid
+command:
+ #pid_file /var/run/tty/tty3.pid
- start qingy tty3 -d -l -n -t
+ start agetty -8 9600 tty3 linux
-service:
- pid_file /var/run/tty/tty4.pid
+command:
+ #pid_file /var/run/tty/tty4.pid
- start qingy tty4 -d -l -n -t
+ start agetty -8 9600 tty4 linux
flockfile(main.error.to.stream);
fl_print_format("%c%[%SThe section operation '%]", main.error.to.stream, f_string_eol_s[0], main.error.context, main.error.prefix, main.error.context);
- fl_print_format("%[%Q%]", main.error.to.stream, main.error.notable, operation_name, main.error.notable);
+ fl_print_format("%[%/Q%]", main.error.to.stream, main.error.notable, buffer, operation_name, main.error.notable);
fl_print_format("%[' from section '%]", main.error.to.stream, main.error.context, main.error.context);
- fl_print_format("%[%Q%]", main.error.to.stream, main.error.notable, section_name, main.error.notable);
- fl_print_format("%[' on line %]", main.error.to.stream, main.error.context, main.error.context);
+ fl_print_format("%[%/Q%]", main.error.to.stream, main.error.notable, buffer, section_name, main.error.notable);
+ fl_print_format("%[' on line%] ", main.error.to.stream, main.error.context, main.error.context);
fl_print_format("%[%un%]", main.error.to.stream, main.error.notable, line, main.error.notable);
fl_print_format(" %[failed.%]%c", main.error.to.stream, main.error.context, main.error.context, f_string_eol_s[0]);