[why] When a job-task fails(exit_code != 0), the on_fail function needs to be called to keep the program in the waiting state to user adjustment
Signed-off-by: Hu XueJiao 1034502035@qq.com --- bin/run-lkp | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/bin/run-lkp b/bin/run-lkp index 26669331..b422a7eb 100755 --- a/bin/run-lkp +++ b/bin/run-lkp @@ -97,6 +97,10 @@ elif [ "$run_job_exit_code" != 0 ]; then else set_job_state 'failed' fi + + source $job_script + [ "$(type -t on_fail)" = "function" ] && $LKP_DEBUG_PREFIX $job_script on_fail + elif [ -f '/var/log/wtmp' ] && has_cmd last && last -n1 | grep -q -E '(pts/|tty)[0-9].*(still logged in)'; then set_job_state 'disturbed' disturbed=1
On Tue, Nov 17, 2020 at 03:17:51PM +0800, Hu Xuejiao wrote:
[why] When a job-task fails(exit_code != 0), the on_fail function needs to be called to keep the program in the waiting state to user adjustment
Signed-off-by: Hu XueJiao 1034502035@qq.com
bin/run-lkp | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/bin/run-lkp b/bin/run-lkp index 26669331..b422a7eb 100755 --- a/bin/run-lkp +++ b/bin/run-lkp @@ -97,6 +97,10 @@ elif [ "$run_job_exit_code" != 0 ]; then else set_job_state 'failed' fi
source $job_script
[ "$(type -t on_fail)" = "function" ] && $LKP_DEBUG_PREFIX $job_script on_fail
avoid use $(command) in test
Thanks, Luan Shengde
elif [ -f '/var/log/wtmp' ] && has_cmd last && last -n1 | grep -q -E '(pts/|tty)[0-9].*(still logged in)'; then set_job_state 'disturbed' disturbed=1 -- 2.23.0