From 4b97f385570be844ad446585f783a332a28e0dd9 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 26 Jul 2010 16:00:49 +0200 Subject: [PATCH] update-stats: Close logging.conf before reloading lighttpd. Previously, lighttpd would sometimes read a half-finished logging.conf and fail to start. --- usr/local/bin/update-stats | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/update-stats b/usr/local/bin/update-stats index 7f3fb42..2591ff4 100755 --- a/usr/local/bin/update-stats +++ b/usr/local/bin/update-stats @@ -140,6 +140,7 @@ 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 @@ -148,8 +149,8 @@ if lighttpd_conf != f.read(): if ret != 0: print >> sys.stderr, "Reloading lighttpd failed. Logging.conf was:" print >> sys.stderr, lighttpd_conf - -f.close() +else: + f.close() # Now, run awstats to parse log files. -- 2.30.2