Troubleshooting Hook Scripts

squirrelbeach

New Member
Mar 16, 2024
8
2
3
Is there some information or guide on troubleshooting hook scripts?

I can see the log showing which line failed, and the script exit code, but there is no information showing why the failed line of the hookscript encountered an error.

What I'd really like is some more verbose output in the log, eg. showing what the terminal's fail message was for that line of script.



I was running a fork of the geco-it FCOS script by jimlee2048 on the current version of Fedora Core.

The line that failed was in pre-start, iirc it was attempting to create a profile directory.


Thanks in advance!
 
Last edited:
if it's a shell script, you can `set -x` at the top and it will print everything that's executed (including variable contents for things like branches).
 
if it's a shell script, you can `set -x` at the top and it will print everything that's executed (including variable contents for things like branches).
Thanks for the reply.

The script has been running with `set -x`, the issue is that the script is exiting when commands fail and the log isn't showing what the cause of the failure is, eg. ` mkdir -p ${COREOS_FILES_PATH} || set -xv; exec 3>&-; exit 1`

I think that finding the error messages is my best shot at troubleshooting the issue, unfortunately they don't appear in the taskviewer output.
 
Last edited:
we are not redirecting the output of the hookscript AFAICT..