|
|
function safe cmd in split format
|
|
= NAME =safe_cmd
|
|
|
= SYNOPSIS =safe_cmd "<command>"
|
|
|
= DESCRIPTION =This function is used to execute a command on the target with a greaterdegree of safety. In particular, the oom score for the process isadjusted so that if the target platform 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 adjustthe 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 adjustthe 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 memoryor 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 memoryor 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''
|
|
ov_rootfs_oom, report, report_append
|
= SEE ALSO = * [[function_ov_rootfs_oom|ov_rootfs_oom]], [[function_report|report]], [[function_report_append|report_append]]
|
|
|