From 5a792a0d6abed34ba781db1feb47234c87949725 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Jan 2016 15:25:30 +0530 Subject: [PATCH] ... --- setup/plugins_mirror.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/plugins_mirror.py b/setup/plugins_mirror.py index dcf602c3ab..8d82e0346d 100644 --- a/setup/plugins_mirror.py +++ b/setup/plugins_mirror.py @@ -495,7 +495,7 @@ def singleinstance(): def update_stats(): log = olog = 'stats.log' - if os.geteuid() != 0 or not os.path.exists(log): + if not os.path.exists(log): return {} stats = {} if IS_PRODUCTION: @@ -505,6 +505,8 @@ def update_stats(): except EnvironmentError as err: if err.errno != errno.ENOENT: raise + if os.geteuid() != 0: + return stats log = 'rotated-' + log os.rename(olog, log) subprocess.check_call(['/usr/sbin/nginx', '-s', 'reopen'])