FrontPage 

Fuego wiki

Login or create account

function safe cmd in split format

NAME [edit section]

= NAME =
safe_cmd

SYNOPSIS [edit section]

= SYNOPSIS =
safe_cmd "<command>"

DESCRIPTION [edit section]

= DESCRIPTION =
This function is used to execute a command on the target with a greater
degree of safety.  In particular, the oom score for the process is
adjusted so that if the target board runs out of memory during the execution, it will be the first process killed on the system.
It basically just calls ov_rootfs_oom to adjust the oom score, and then calls cmd with the command to execute on target.
It basically just calls [[function_ov_rootfs_oom|ov_rootfs_oom]] to adjust
the oom score, and then calls [[function_cmd|cmd]] with the command to execute on target.
This is chiefly used by report and report_append to avoid problems overflowing memory or disturbing other processes when executing the main command to execute the test.
This is chiefly used by [[function_report|report]] and [[function_report_append|report_append]] to avoid problems overflowing memory
or disturbing other processes when executing the main command to execute the test.

EXAMPLES [edit section]

= EXAMPLES =
Here are some sample invocations:
{{{#!YellowBox
    safe_cmd "{ $1; echo \$? > $RETCODE; } 2>&1 | tee $2; exit \$(cat $RETCODE; rm $RETCODE &>/dev/null)"
}}}

ENVIRONMENT and ARGUMENTS [edit section]

= ENVIRONMENT and ARGUMENTS =
This function takes one positional argument, which is the command to execute.

RETURN [edit section]

= RETURN =
Returns non-zero on error.

SOURCE [edit section]

= SOURCE =
Located in ''scripts/functions.sh''

SEE ALSO [edit section]

ov_rootfs_oom, report, report_append
= SEE ALSO =
 * [[function_ov_rootfs_oom|ov_rootfs_oom]], [[function_report|report]], [[function_report_append|report_append]]
TBWiki engine 1.8.3 by Tim Bird