-
Notifications
You must be signed in to change notification settings - Fork 3
Description
[LLM generated issue]
When hestiacp-pluginable is installed, backups scheduled via GUI or cron never execute. The backup.pipe queue accumulates entries that are never consumed. The GUI shows "a backup is already running" but no backup process exists.
HestiaCP version: 1.9.4
OS: Debian 12 (bookworm) aarch64
Plugin: hestiacp-pluginable v2.0.4
Root cause
The process guard in v-update-sys-queue (around lines 37-43) counts running instances using:
b_task=$(ps auxf | grep -v "grep" | grep "$BIN/v-update-sys-queue backup")
b_task=$(echo "$b_task" | grep -v sudo | wc -l)
if [ "$b_task" -gt 2 ] || [ "$d_task" -gt 2 ]; then
exit
fiWith hestiacp-pluginable installed, every v-* command is intercepted by /etc/hestiacp/hooks/local.conf, which runs php pluginable.php and then re-invokes the original script via proc_open with bin_actions=1.
This creates a process tree with 4-5 entries all matching the grep pattern:
- Parent shell
- Original intercepted v-update-sys-queue backup
- PHP pluginable.php child
- proc_open re-invocation with bin_actions=1
The count always exceeds the threshold of 2, so the guard exits before processing the backup pipe.
Steps to reproduce
- Install hestiacp-pluginable (https://github.com/nickvdyck/hestiacp-pluginable)
- Schedule a backup via GUI or wait for cron
- Observe that backup.pipe entries are never consumed
- Verify with: ps auxf | grep v-update-sys-queue shows nested process tree
Expected behavior
Backups should execute regardless of the pluginable hook system.
Workaround
Replace the ps auxf | grep | wc -l process guard with a PID-based lock file:
LOCK_DIR="$HESTIA/data/queue"
if [ "$queue" = "backup" ] || [ "$queue" = "dns" ]; then
LOCK_FILE="$LOCK_DIR/$queue.lock"
if [ -f "$LOCK_FILE" ]; then
LOCK_PID=$(cat "$LOCK_FILE" 2>/dev/null)
if [ -n "$LOCK_PID" ] && kill -0 "$LOCK_PID" 2>/dev/null; then
exit
fi
rm -f "$LOCK_FILE"
fi
echo $$ > "$LOCK_FILE"
trap "rm -f '$LOCK_FILE'" EXIT
fiAdditional context
The ps auxf approach for process guarding is fragile in general — any wrapper, hook system, or shell nesting that puts v-update-sys-queue in the command line of parent processes will inflate the count. A lock file mechanism is more robust.
Thank you.