diff --git a/tools/restart-server b/tools/restart-server index c8bd0c89fe..88fa9c401e 100755 --- a/tools/restart-server +++ b/tools/restart-server @@ -14,6 +14,12 @@ logging.basicConfig(format="%(asctime)s restart-server: %(message)s", deploy_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) os.chdir(deploy_path) +if os.path.exists("/etc/humbug-server"): + with open("/etc/humbug-machinetype") as mtf: + if os.getlogin() != "humbug": + logging.error("Must be run as user 'humbug'.") + sys.exit(1) + # Send a statsd event on restarting the server subprocess.check_call(["python", "./manage.py", "send_stats", "incr", "events.server_restart", str(int(time.time()))])