August 2Aug 2 Noobie needing help here. I am trying to run a hook script to put gpus to idle after vm shutdown. But with any script I put in /etc/libvert/hooks/qemu.d/, I get this error on vm startup. I chmod everything. Even if the script does nothing, still get this error. My qemu is version 9.2.3.Script is #!/bin/bash if [[ $2 == "release" ]] then bash /mnt/user/isos/scripts/nvidia_idle fi Edited August 2Aug 2 by kakashisensei
August 3Aug 3 Author 14 hours ago, Jorgen said:ls -l /etc/libvirt/hooks/qemu.dthis is what i getls -l /etc/libvirt/hooks/qemu.d total 4 -rwxr-xr-x 1 root root 98 Aug 2 01:17 gpuidle*
August 3Aug 3 Author i am looking at this and it says i need to have folder of the vm name in qemu.d. once i put the script in vm name folder, i stop getting this error message and the vm starts. the doc states i can put the script in /etc/libvirt/hooks/qemu.d/$vmname/release/end/ and it should execute after the vm has turned off and released resources. but it still isnt working when i exit the vm. i have chmod the scripts and have tested the scripts run fine when i manually run them in terminal.
August 3Aug 3 I think unraid does it differently compared to the guide you're referring to.See here for an older example: https://forums.unraid.net/topic/126883-running-a-script-after-shutting-down-a-vm/Although, it makes sense to separate the scripts for different VMs with the "$vmname" path.Sorry I'm out of my depth here, I was testing hooks for the same purpose a while back but can't remember if I got them working or not. Hopefully someone more knowledgeable will come along and help. Edited August 3Aug 3 by Jorgen
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.