restarting multiple instances of apache - newbie Q

M

mikeisgreat

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top