Bug 12555 - Toaster will not shut down due to extra PID from Django
Summary: Toaster will not shut down due to extra PID from Django
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.4.1
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.5 M3
Assignee: David Reyna
QA Contact: Toaster default assignee
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-02-15 23:21 UTC by David Reyna
Modified: 2018-04-15 00:25 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)