Hello everyone,
i'm using the following hook script so that after a Proxmox server restart, the USB device ID is passed to the LXC container. However, this script is now being executed repeatedly. It should only run when the LXC container starts. Is the script in a loop? Who can check this? I'm hoping for some help.
I can see this in the journal and from the high process ID.
Journal:
ps
Regards, Stefan Harbich
i'm using the following hook script so that after a Proxmox server restart, the USB device ID is passed to the LXC container. However, this script is now being executed repeatedly. It should only run when the LXC container starts. Is the script in a loop? Who can check this? I'm hoping for some help.
I can see this in the journal and from the high process ID.
Journal:
Code:
Nov 01 21:32:06 psme02 systemd[1]: coral.service: Scheduled restart job, restart counter is at 198011.
Nov 01 21:32:06 psme02 systemd[1]: Started coral.service - Coral Bus Device-ID service.
Nov 01 21:32:06 psme02 coral-init.sh[3642792]: 2025-11-01 21:32:06 - Running pre-start hookscript for LXC 106
Nov 01 21:32:06 psme02 coral-init.sh[3642795]: 2025-11-01 21:32:06 - DEBUG: Using config file: /etc/pve/lxc/106.conf
Nov 01 21:32:06 psme02 coral-init.sh[3642801]: 2025-11-01 21:32:06 - Google Coral TPU is already initialized!
Nov 01 21:32:06 psme02 coral-init.sh[3642808]: 2025-11-01 21:32:06 - DEBUG: Found device line: Bus 004 Device 002: ID 18d1:9302 Google Inc.
Nov 01 21:32:06 psme02 coral-init.sh[3642819]: 2025-11-01 21:32:06 - DEBUG: Extracted raw numbers - Bus: 4, Device: 2
Nov 01 21:32:06 psme02 coral-init.sh[3642824]: 2025-11-01 21:32:06 - DEBUG: Padded numbers - Bus: 004, Device: 002
Nov 01 21:32:06 psme02 coral-init.sh[3642827]: 2025-11-01 21:32:06 - DEBUG: Constructed device path: /dev/bus/usb/004/002
Nov 01 21:32:06 psme02 coral-init.sh[3642830]: 2025-11-01 21:32:06 - Found Coral TPU at: /dev/bus/usb/004/002
Nov 01 21:32:06 psme02 coral-init.sh[3642836]: 2025-11-01 21:32:06 - DEBUG: Current device line: 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:06 psme02 coral-init.sh[3642839]: 2025-11-01 21:32:06 - DEBUG: New device line: 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:06 psme02 coral-init.sh[3642843]: 2025-11-01 21:32:06 - Updated device path from 'dev0: /dev/bus/usb/004/002' to 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:06 psme02 coral-init.sh[3642847]: 2025-11-01 21:32:06 - Configuration update successful
Nov 01 21:32:06 psme02 coral-init.sh[3642852]: 2025-11-01 21:32:06 -
Nov 01 21:32:06 psme02 systemd[1]: coral.service: Deactivated successfully.
Nov 01 21:32:07 psme02 systemd[1]: coral.service: Scheduled restart job, restart counter is at 198012.
Nov 01 21:32:07 psme02 systemd[1]: Started coral.service - Coral Bus Device-ID service.
Nov 01 21:32:08 psme02 coral-init.sh[3642903]: 2025-11-01 21:32:08 - Running pre-start hookscript for LXC 106
Nov 01 21:32:08 psme02 coral-init.sh[3642906]: 2025-11-01 21:32:08 - DEBUG: Using config file: /etc/pve/lxc/106.conf
Nov 01 21:32:08 psme02 coral-init.sh[3642912]: 2025-11-01 21:32:08 - Google Coral TPU is already initialized!
Nov 01 21:32:08 psme02 coral-init.sh[3642919]: 2025-11-01 21:32:08 - DEBUG: Found device line: Bus 004 Device 002: ID 18d1:9302 Google Inc.
Nov 01 21:32:08 psme02 coral-init.sh[3642930]: 2025-11-01 21:32:08 - DEBUG: Extracted raw numbers - Bus: 4, Device: 2
Nov 01 21:32:08 psme02 coral-init.sh[3642935]: 2025-11-01 21:32:08 - DEBUG: Padded numbers - Bus: 004, Device: 002
Nov 01 21:32:08 psme02 coral-init.sh[3642938]: 2025-11-01 21:32:08 - DEBUG: Constructed device path: /dev/bus/usb/004/002
Nov 01 21:32:08 psme02 coral-init.sh[3642941]: 2025-11-01 21:32:08 - Found Coral TPU at: /dev/bus/usb/004/002
Nov 01 21:32:08 psme02 coral-init.sh[3642947]: 2025-11-01 21:32:08 - DEBUG: Current device line: 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:08 psme02 coral-init.sh[3642950]: 2025-11-01 21:32:08 - DEBUG: New device line: 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:08 psme02 coral-init.sh[3642954]: 2025-11-01 21:32:08 - Updated device path from 'dev0: /dev/bus/usb/004/002' to 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:08 psme02 coral-init.sh[3642958]: 2025-11-01 21:32:08 - Configuration update successful
Nov 01 21:32:08 psme02 coral-init.sh[3642963]: 2025-11-01 21:32:08 -
Nov 01 21:32:08 psme02 systemd[1]: coral.service: Deactivated successfully.
Nov 01 21:32:09 psme02 systemd[1]: coral.service: Scheduled restart job, restart counter is at 198013.
Nov 01 21:32:09 psme02 systemd[1]: Started coral.service - Coral Bus Device-ID service.
Nov 01 21:32:09 psme02 coral-init.sh[3642974]: 2025-11-01 21:32:09 - Running pre-start hookscript for LXC 106
Nov 01 21:32:09 psme02 coral-init.sh[3642977]: 2025-11-01 21:32:09 - DEBUG: Using config file: /etc/pve/lxc/106.conf
Nov 01 21:32:09 psme02 coral-init.sh[3642983]: 2025-11-01 21:32:09 - Google Coral TPU is already initialized!
Nov 01 21:32:09 psme02 coral-init.sh[3642990]: 2025-11-01 21:32:09 - DEBUG: Found device line: Bus 004 Device 002: ID 18d1:9302 Google Inc.
Nov 01 21:32:09 psme02 coral-init.sh[3643001]: 2025-11-01 21:32:09 - DEBUG: Extracted raw numbers - Bus: 4, Device: 2
Nov 01 21:32:09 psme02 coral-init.sh[3643006]: 2025-11-01 21:32:09 - DEBUG: Padded numbers - Bus: 004, Device: 002
Nov 01 21:32:09 psme02 coral-init.sh[3643009]: 2025-11-01 21:32:09 - DEBUG: Constructed device path: /dev/bus/usb/004/002
Nov 01 21:32:09 psme02 coral-init.sh[3643012]: 2025-11-01 21:32:09 - Found Coral TPU at: /dev/bus/usb/004/002
Nov 01 21:32:09 psme02 coral-init.sh[3643018]: 2025-11-01 21:32:09 - DEBUG: Current device line: 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:09 psme02 coral-init.sh[3643021]: 2025-11-01 21:32:09 - DEBUG: New device line: 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:09 psme02 coral-init.sh[3643025]: 2025-11-01 21:32:09 - Updated device path from 'dev0: /dev/bus/usb/004/002' to 'dev0: /dev/bus/usb/004/002'
Nov 01 21:32:09 psme02 coral-init.sh[3643029]: 2025-11-01 21:32:09 - Configuration update successful
Nov 01 21:32:09 psme02 coral-init.sh[3643034]: 2025-11-01 21:32:09 -
Nov 01 21:32:09 psme02 systemd[1]: coral.service: Deactivated successfully.
Nov 01 21:32:10 psme02 systemd[1]: coral.service: Scheduled restart job, restart counter is at 198014.
..
Code:
root@psme02:~# ps aux | grep coral-init.sh
root 887080 0.0 0.0 6660 1260 pts/0 S+ 21:49 0:00 grep coral-init.sh
root@psme02:~# ps aux | grep coral-init.sh
root 887222 0.0 0.0 6660 1264 pts/0 S+ 21:49 0:00 grep coral-init.sh
root@psme02:~# ps aux | grep coral-init.sh
root 887386 0.0 0.0 6660 1228 pts/0 S+ 21:49 0:00 grep coral-init.sh
root@psme02:~# ps aux | grep coral-init.sh
root 887547 0.0 0.0 6660 1224 pts/0 S+ 21:49 0:00 grep coral-init.sh