f.seek(0)
f.truncate()
f.write(lighttpd_conf)
+ f.close()
# Reload lighttpd configuration
print "Reloading lighttpd: %s" % reload_lighttpd
- subprocess.call(reload_lighttpd, shell=True)
-
-f.close()
+ ret = subprocess.call(reload_lighttpd, shell=True)
+
+ if ret != 0:
+ print >> sys.stderr, "Reloading lighttpd failed. Logging.conf was:"
+ print >> sys.stderr, lighttpd_conf
+else:
+ f.close()
# Now, run awstats to parse log files.