FrontPage 

Fuego wiki

Login or create account

function safe cmd in 'raw' format

= NAME =
safe_cmd

= SYNOPSIS =
safe_cmd "<command>"

= 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 [[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 [[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 =
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 =
This function takes one positional argument, which is the command to execute.

= RETURN =
Returns non-zero on error.

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

= 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