Adam,
That works for cmd.exe! FYI, python.exe wasn't working for me when I sent that message, but I apparently overwrote it with a 0B file; once restored, it did what you said. The command I listed above (sans w) works in cmd.exe and in a batch file run from cmd.exe. Thank you for pointing out my problem!
My next challenge, if you're willing to keep diving into madness with me, is how to make this work from cygwin. If I run the cygwin command I pasted above (with python.exe rather than pythonw.exe):
1. If I ctrl+c then there is no clean shutdown, and two python.exe processes keep running.
2. If I run cmd.exe /c the_batch_file_that_works_from_cmd.bat, then ctrl+c it, or kill -SIGINT it, then there is no clean shutdown, and one python.exe processes keep running.
3. I can kill the process with taskkill /f /t, then there is no clean shutdown, and no python.exe processes keep running. So I guess this is the best so far!
Any ideas on how to make the clean shutdown happen?
I've included three example invocations to make this more clear.
Example invocation: run from a batch file, then ctrl+c. Result: neither Python process is killed.
Bartholomew@Bartholomew2014 ~/dev/orders
$ ./serve_app_internal.bat
C:\Users\Bartholomew\Documents\dev\orders>c:\Python27\python.exe "c:\Program Files (x86)\Google\google_appengine\dev_appserver.py" --skip_sdk_update_check=yes --port=8080 --admin_port=8000 app/app.yaml app/long-running.yaml app/dispatch.yaml
INFO 2016-04-25 04:13:48,437 devappserver2.py:769] Skipping SDK update check.
<snip more startup stuff>
<here I wait for a minute, then hit Ctrl+C>
Bartholomew@Bartholomew2014 ~/dev/orders
$
Example invocation: run from cygwin in the background, then kill the process with sigint. Result: One python process is killed.
Bartholomew@Bartholomew2014 ~/dev/orders
$ /cygdrive/c/python27/python.exe C:\\Program\ Files\ \(x86\)\\Google\\google_appengine\\dev_appserver.py --skip_sdk_update_check=yes --port=$port --admin_port=$admin_port app/app.yaml app/long-running.yaml app/dispatch.yaml &
[1] 8588
Bartholomew@Bartholomew2014 ~/dev/orders
$ INFO 2016-04-25 04:30:00,427 devappserver2.py:769] Skipping SDK update check.
WARNING 2016-04-25 04:30:00,562 simple_search_stub.py:1126] Could not read search indexes from c:\cygwin64\tmp\appengine.paumpa-orders\search_indexes
<snip>
<hit enter just to give me a prompt>
Bartholomew@Bartholomew2014 ~/dev/orders
$ kill -SIGINT 8588
Bartholomew@Bartholomew2014 ~/dev/orders
$ <hit enter so I can see the interrupt>
[1]+ Interrupt /cygdrive/c/python27/python.exe C:\\Program\ Files\ \(x86\)\\Google\\google_appengine\\dev_appserver.py --skip_sdk_update_check=yes --port=$port --admin_port=$admin_port app/app.yaml app/long-running.yaml app/dispatch.yaml
Example invocation: run from cygwin in the background, then kill the process with taskkill /f /t. Result: All processes die, but the shutdown is not graceful
Bartholomew@Bartholomew2014 ~/dev/orders
$ /cygdrive/c/python27/python.exe C:\\Program\ Files\ \(x86\)\\Google\\google_appengine\\dev_appserver.py --skip_sdk_update_check=yes --port=$port --admin_port=$admin_port app/app.yaml app/long-running.yaml app/dispatch.yaml &
[2] 9644
Bartholomew@Bartholomew2014 ~/dev/orders
$ INFO 2016-04-25 05:25:09,456 devappserver2.py:769] Skipping SDK update check.
<snip>
Bartholomew@Bartholomew2014 ~/dev/orders
$ taskkill /PID 9644 /f /t
SUCCESS: The process with PID 8664 (child process of PID 9560) has been terminated.
SUCCESS: The process with PID 9560 (child process of PID 9644) has been terminated.
SUCCESS: The process with PID 9644 (child process of PID 2604) has been terminated.
[2]+ Exit 1 /cygdrive/c/python27/python.exe C:\\Program\ Files\ \(x86\)\\Google\\google_appengine\\dev_appserver.py --skip_sdk_update_check=yes --port=$port --admin_port=$admin_port app/app.yaml app/long-running.yaml app/dispatch.yaml
Bartholomew@Bartholomew2014 ~/dev/orders
$