CGI zombies with Apache 1.3 on Linux

Discussion in 'Python' started by Robert Brewer, Dec 10, 2004.

  1. I've Googled extensively, but can't figure out what might be causing my
    Python CGI app to zombie (yes, Tibia, the one I just announced ;). The
    cgi bit looks like this:


    def cgi_handler():
    import cgi

    form = cgi.FieldStorage(keep_blank_values=True)
    params = dict([(key, form[key].value) for key in form])

    env = os.environ.get
    filename = env('PATH_TRANSLATED') or env('SCRIPT_FILENAME')
    username = env('AUTH_USER') or env('REMOTE_USER') or
    env('LOGON_USER')
    app = TibiaApp(params, filename, username)
    print "Content-type: %s\n" % app.content_type
    print "".join(app.output)


    if __name__ == '__main__':
    cgi_handler()



    Should I be explicitly closing stdout at the end of cgi_handler()? I
    don't get a zombie with every request.



    Robert Brewer
    MIS
    Amor Ministries
     
    Robert Brewer, Dec 10, 2004
    #1
    1. Advertisements

  2. Robert Brewer wrote:

    > I've Googled extensively, but can't figure out what might be causing my
    > Python CGI app to zombie (yes, Tibia, the one I just announced ;). The
    > cgi bit looks like this:


    Zombies are caused by forking a subprocess and the parent not waiting on
    it. Does your system (sometimes) spin off a subprocess?

    --
    Erik Max Francis && && http://www.alcyone.com/max/
    San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
    Defeat is a school in which truth always grows strong.
    -- Henry Ward Beecher
     
    Erik Max Francis, Dec 10, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jsnx

    the secret life of zombies

    jsnx, Oct 12, 2007, in forum: Python
    Replies:
    2
    Views:
    324
  2. jsnx

    the secret life of zombies

    jsnx, Oct 12, 2007, in forum: Python
    Replies:
    0
    Views:
    331
  3. bitcycle
    Replies:
    3
    Views:
    551
    Nobody
    Jul 7, 2011
  4. Zach Dennis

    Ruby as CGI with Apache on Linux

    Zach Dennis, Dec 18, 2003, in forum: Ruby
    Replies:
    1
    Views:
    405
    Ara.T.Howard
    Dec 18, 2003
  5. Rex Gustavus Adolphus
    Replies:
    5
    Views:
    341
    Rex Gustavus Adolphus
    Jul 4, 2003
  6. Uri Guttman

    perl zombies

    Uri Guttman, Aug 16, 2003, in forum: Perl Misc
    Replies:
    17
    Views:
    316
    Hudson
    Aug 25, 2003
  7. Hal Vaughan

    Dealing With Zombies in a Daemon

    Hal Vaughan, Aug 30, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    223
    Hal Vaughan
    Sep 1, 2005
  8. BestFriend
    Replies:
    2
    Views:
    1,144
Loading...