start_devserver: cleaner handling of signals

This simplified and robustifies the signal handling and termination of
the child process (devserver) in several ways:

* There's no need to set a flag when trapping a signal: it is sufficient
  to check the return status of the wait built-in (if >= 128, it was
  interrupted by a signal).

* Be sure to wait for the subprocess' termination, regardless of
  repeated signals. This ensures that we do not leave zombie devservers

* Note that this may send multiple SIGTERMs to the child process (one
  for each signal trapped by start_devserver).  This is probably
  harmless, and makes the code simpler.

TEST=devserver killed cleanly

Change-Id: Ibe648285b461048f681e464ab2ba6c9a7445841d
Reviewed-by: Darin Petkov <>
Reviewed-by: Richard Barnette <>
Commit-Ready: Gilad Arnold <>
Tested-by: Gilad Arnold <>
1 file changed