fix(queue-daemon): call kugetsu_add_notification from bash instead of os.system() #167

Closed
opened 2026-04-06 02:31:34 +02:00 by shoko · 0 comments
Owner

Problem

When update_queue_item_state() sets state to 'completed' or 'error' in kugetsu-index.sh, it tries to call kugetsu_add_notification via os.system():

This fails silently because os.system() spawns a NEW subprocess, and bash functions are not visible to child processes. kugetsu_add_notification is a bash function, not an executable command.

Impact

  • task_completed notification never fires
  • task_error notification never fires
  • task_queued works fine (called directly from bash)

Root Cause

os.system() creates a new shell subprocess that cannot access bash functions defined in the parent shell.

Expected Fix

Call kugetsu_add_notification directly from bash in update_queue_item_state(), not via os.system(). The function is available since kugetsu-index.sh is sourced before update_queue_item_state is called.

Alternative: Make notification a standalone script that can be called via PATH.

Severity

High - Notifications broken for completed/error states

## Problem When update_queue_item_state() sets state to 'completed' or 'error' in kugetsu-index.sh, it tries to call kugetsu_add_notification via os.system(): This fails silently because os.system() spawns a NEW subprocess, and bash functions are not visible to child processes. kugetsu_add_notification is a bash function, not an executable command. ## Impact - task_completed notification never fires - task_error notification never fires - task_queued works fine (called directly from bash) ## Root Cause os.system() creates a new shell subprocess that cannot access bash functions defined in the parent shell. ## Expected Fix Call kugetsu_add_notification directly from bash in update_queue_item_state(), not via os.system(). The function is available since kugetsu-index.sh is sourced before update_queue_item_state is called. Alternative: Make notification a standalone script that can be called via PATH. ## Severity High - Notifications broken for completed/error states
shoko closed this issue 2026-04-06 02:35:37 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#167