Bug 12555

Summary: Toaster will not shut down due to extra PID from Django
Product: [Build System, Metadata & Runtime] Toaster Reporter: David Reyna <david.reyna>
Component: toasterAssignee: David Reyna <david.reyna>
Status: RESOLVED FIXED QA Contact: Toaster default assignee <toaster>
Severity: normal    
Priority: Medium+ CC: jessica.zhang, stanciux.mihail
Version: 2.4.1   
Target Milestone: 2.5 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description David Reyna 2018-02-15 23:21:31 UTC
1) Django has a habit of creating an extra PID which Toaster cannot capture, and which leads to dangling processes and memory leaks.

The solution is to use the "--noreload" option for "runserver".

2) Toaster has a typo in the shutdown code that causes an infinite loop if the PIDs cannot be killed with a simple "-0".

  while kill -0 $pid 2>/dev/null; do
    kill -SIGTERM -$pid 2>/dev/null
------------------^
    sleep 1
  done

Removing the extra "-" results in safe and sane shutdowns.
Comment 1 David Reyna 2018-04-15 00:25:10 UTC
 (Bitbake rev: 256990943075e89cb9aee2bc6488344b6783e07b)