Troubleshooting Hook Scripts

squirrelbeach

New Member
Mar 16, 2024
7
0
1
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..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!