From 7e5a3203436e85e06ccd136dc34d24ba1a9ca113 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 5 Oct 2017 12:37:49 -0700 Subject: [PATCH] zephyr_mirror: Move stamp_path to not be based on root_path. --- zulip/integrations/zephyr/zephyr_mirror_backend.py | 7 +++++-- zulip/integrations/zephyr/zmirror_private.conf.template | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zulip/integrations/zephyr/zephyr_mirror_backend.py b/zulip/integrations/zephyr/zephyr_mirror_backend.py index 8162aab..e8574c7 100755 --- a/zulip/integrations/zephyr/zephyr_mirror_backend.py +++ b/zulip/integrations/zephyr/zephyr_mirror_backend.py @@ -233,9 +233,9 @@ def maybe_kill_child(): def maybe_restart_mirroring_script(): # type: () -> None - if os.stat(os.path.join(options.root_path, "stamps", "restart_stamp")).st_mtime > start_time or \ + if os.stat(os.path.join(options.stamp_path, "stamps", "restart_stamp")).st_mtime > start_time or \ ((options.user == "tabbott" or options.user == "tabbott/extra") and - os.stat(os.path.join(options.root_path, "stamps", "tabbott_stamp")).st_mtime > start_time): + os.stat(os.path.join(options.stamp_path, "stamps", "tabbott_stamp")).st_mtime > start_time): logger.warning("") logger.warning("zephyr mirroring script has been updated; restarting...") maybe_kill_child() @@ -1031,6 +1031,9 @@ def parse_args(): parser.add_option('--root-path', default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends", help=optparse.SUPPRESS_HELP) + parser.add_option('--stamp-path', + default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends", + help=optparse.SUPPRESS_HELP) parser.add_option('--session-path', default=None, help=optparse.SUPPRESS_HELP) diff --git a/zulip/integrations/zephyr/zmirror_private.conf.template b/zulip/integrations/zephyr/zmirror_private.conf.template index 1ebf70c..8278701 100644 --- a/zulip/integrations/zephyr/zmirror_private.conf.template +++ b/zulip/integrations/zephyr/zmirror_private.conf.template @@ -1,5 +1,5 @@ [program:zmirror-USERNAME] -command=/home/zulip/python-zulip-api/zulip/integrations/zephyr/zephyr_mirror_backend.py --user=USERNAME --log-path=/home/zulip/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/zulip/zephyr_sessions/%(program_name)s --api-key-file=/home/zulip/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/zulip/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios --site=https://zephyr.zulipchat.com +command=/home/zulip/python-zulip-api/zulip/integrations/zephyr/zephyr_mirror_backend.py --stamp-path=/home/zulip/zulip --user=USERNAME --log-path=/home/zulip/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/zulip/zephyr_sessions/%(program_name)s --api-key-file=/home/zulip/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/zulip/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios --site=https://zephyr.zulipchat.com priority=200 ; the relative start priority (default 999) autostart=true ; start at supervisord start (default: true) autorestart=true ; whether/when to restart (default: unexpected)