I may very well be failing to understand something about launchctl plist files. Thanks!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
I found this posting on Stack Overflow that leads me to believe the problem is primarily with bottle.py, the Python framework I'm using. However, there does seem to be one thing with launchd that is triggering this problem, and I'd like some feedback. First, here's the Stack Overflow post:
And here is the part from there that has got me thinking:
The only way I have been able to reproduce the issue is when I try to run a second script on my Ubuntu server that creates another server listening to a different port (ie.: exactly the same script as above but port=3001). If I send a request to the newly created server, I also do not get a response and the connection eventually times out.
Here's the thing—launchd seems to be firing off two processes. I've confirmed this by running "ps aux" in Terminal. That seems similar to what the guy in the post quoted is doing manually. Does anyone know why there would be two processes launched by launchd? Is there a way to restrict it to one process?
Your job will only be restarted if it exits with status zero. If it crashes, it won't be restarted. Also, you specify launch-on-demand from the http-alt port, but you also specify run at load. They're inconsistent.
If your script does not daemonize or fork, you should remove the RunAtLoad and KeepAlive keys. If it's unable to accept the socket handoff, which is likely, you should also remove the Sockets key.
THIS SOLVED MY QUESTION
Sorry, I clicked "This helped me" because your post was very informative, and I figured that I should give it a few days to see if the server's behavior changed after making your suggested changes. I have not had the problem since making the changes you suggested, and returned to indicate that your post solved my question. However, it seems that once you click "This helped me" the "This solved my question" choice is no longer available.
I would mark your reply properly if I could. Thanks again!