If a GCI loop executes in the woods and no body hears it...

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

If a GCI loop executes in the woods and no body hears it...

Post by Isaac »

So you know how letting Isaac experiment on your server can be bad? ...

If I executed a python script and accidentally left a loop that would keep adding to a variable, one number at a time, would it die if I closed the browser? Or is there a chance it's still going... If so, did hitting refresh a bunch of times execute a bunch of other instances of the same program?
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Post by Isaac »

Can I
import os
os.system(\"killall python\")
?
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Post by Isaac »

Also, I executed these yesterday and the server is still running... I guess that means there's no problem, right?
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Post by Jeff250 »

If you close your browser? Are you talking about Web programming server-side with Python? How are you interfacing python with your server? With mod_python? Cgi? Fastcgi? Wsgi?
User avatar
Sirius
DBB Master
DBB Master
Posts: 5616
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Post by Sirius »

If in doubt, power-cycle the machine.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re:

Post by Isaac »

Sirius wrote:If in doubt, power-cycle the machine.
Jeff250 wrote:If you close your browser? Are you talking about Web programming server-side with Python? How are you interfacing python with your server? With mod_python? Cgi? Fastcgi? Wsgi?
It's a script in /Public_HTML/CGI-BIN/test.cgi
Then it gets pointed to by index.html
I've already fixed test.cgi, but since I don't have access to the SSH account, through the terminal, I have no way of running any commands, unless I import os directly in the script... of course I'm not sure what effects killing python would have.

My account is jailed, however.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Post by Isaac »

I have learned from this, that I should always test scripts on my laptop before sending them to the server.
User avatar
Avder
DBB Material Defender
DBB Material Defender
Posts: 4926
Joined: Sat Oct 09, 1999 2:01 am
Location: Moorhead, MN

Post by Avder »

I'm sure if some process of yours is causing problems, the server op would notice it and swiftly kill said process.
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Post by Jeff250 »

With CGI, apache is generally configured with some timeout, where if you don't output anything in X seconds, your script is killed. So if you *aren't* outputting anything in your loop, and your server is sanely configured, your script will eventually die. On the other hand, if you *are* outputting something in a loop, Apache will kill your script when it tries to send your output after the connection has been closed (like when you closed your browser). This may not be immediate, since Apache generally buffers output before sending it.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Post by Isaac »

Oh ok! So my print command would have caused an error when no browser was available to print to. Hmm. I know there's an error log related to this, somewhere...
Post Reply