#1121552 fai-client: task_error does not work inside of executed hooks

Package:
fai-client
Source:
fai-client
Submitter:
Cornelius Hoffmann
Date:
2026-07-12 15:45:01 UTC
Severity:
normal
Tags:
#1121552#5
Date:
2025-11-28 11:31:36 UTC
From:
To:
Dear maintainer,

I'm experiencing a problem with running task_error from hooks/debconf.DEFAULT. The error gets logged, savelog is called, but then the softupdate / install continues like nothing happened. This is due to task_error killing the current process after it, which is just the hook script, since this is executed in anothe process. The check_status function called directly after calling the hook does check the exit code, but doesn't compare it to $STOP_ON_ERROR, so the install just continues.

Reproducer:

mkdir class
mkdir debconf
mkdir hooks
cat <<EOF hooks/debconf.DEFAULT
#!/bin/bash

task_error 777 1 1
EOF
chmod +x hooks/debconf.DEFAULT
fai softupdate -s "file://$(pwd)"

Best,
Cornelius Hoffmann

#1121552#10
Date:
2025-11-28 11:45:08 UTC
From:
To:
Sorry, got two typo in the reproducer

mkdir class
mkdir debconf
mkdir hooks
cat <<EOF >hooks/debconf.DEFAULT
#!/bin/bash

task_error 777 1
EOF
chmod +x hooks/debconf.DEFAULT
fai softupdate -s "file://$(pwd)"


should actually reproduce the problem (with the intended way of calling
task_error)

Best,
Cornelius Hoffmann