X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=usr%2Flocal%2Fbin%2Fupdate-stats;h=2591ff4bf30874cada2f97f0cdcef90abe1a1b43;hb=e3a83cd73d36177c783c51c5bde37e45441b7459;hp=749fed9b11d2ef23f7b11417dac8de498d65328a;hpb=9ca3934aa9d8a853188ed8c8eb5f86e038c933c8;p=matthijs%2Fservers%2Fdrsnuggles.git diff --git a/usr/local/bin/update-stats b/usr/local/bin/update-stats index 749fed9..2591ff4 100755 --- a/usr/local/bin/update-stats +++ b/usr/local/bin/update-stats @@ -140,12 +140,17 @@ if lighttpd_conf != f.read(): 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.