restarting multiple instances of apache - newbie Q

Discussion in 'Python' started by mikeisgreat@gmail.com, Jun 3, 2006.

  1. Guest

    hi all,

    i am new to python programming, so thanks for your patience in advance.

    I have a small script that I am working on that i want to restart
    multiple instances of apaches on our developers servers. We have about
    25 developers each with their own apache.

    <snip>
    import sys, os

    try:
    file = open("users.dat", "r")
    except IOError, message:
    print >> sys.stderr, "File could not be opened:", message
    sys.exit( 1 )

    fdata = file.xreadlines()

    for data in fdata:
    fields = data.split("_")
    # print "USER: " + fields[0] + " ADDRESS: " + fields[1].strip("\n")
    print '/etc/init.d/httpd_' + fields[0] + ' restart

    </snip>

    each users apache is named 'httpd_{user}'

    I am not sure how to do this cleanly other than in a shell script.

    I want to restart the apache and wait until complete to restart the
    next users apache.

    Any advice is appreciated ..

    again, thanks for your time.
    -mike
    , Jun 3, 2006
    #1
    1. Advertising

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. John Wohlbier
    Replies:
    2
    Views:
    355
    Josiah Carlson
    Feb 22, 2004
  2. walterbyrd
    Replies:
    9
    Views:
    292
    Bruno Desthuilliers
    Nov 19, 2006
  3. Replies:
    8
    Views:
    444
    James Stroud
    Jan 29, 2009
  4. Nav
    Replies:
    15
    Views:
    543
    Steven D'Aprano
    Jan 5, 2010
  5. Iain Barnett
    Replies:
    4
    Views:
    295
    Iain Barnett
    Jun 27, 2010
Loading...

Share This Page