zephyr_mirror: Move stamp_path to not be based on root_path.

This commit is contained in:
Tim Abbott 2017-10-05 12:37:49 -07:00
parent 6395dc1a45
commit 7e5a320343
2 changed files with 6 additions and 3 deletions

View file

@ -233,9 +233,9 @@ def maybe_kill_child():
def maybe_restart_mirroring_script(): def maybe_restart_mirroring_script():
# type: () -> None # 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 ((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("")
logger.warning("zephyr mirroring script has been updated; restarting...") logger.warning("zephyr mirroring script has been updated; restarting...")
maybe_kill_child() maybe_kill_child()
@ -1031,6 +1031,9 @@ def parse_args():
parser.add_option('--root-path', parser.add_option('--root-path',
default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends", default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends",
help=optparse.SUPPRESS_HELP) 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', parser.add_option('--session-path',
default=None, default=None,
help=optparse.SUPPRESS_HELP) help=optparse.SUPPRESS_HELP)

View file

@ -1,5 +1,5 @@
[program:zmirror-USERNAME] [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) priority=200 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true) autostart=true ; start at supervisord start (default: true)
autorestart=true ; whether/when to restart (default: unexpected) autorestart=true ; whether/when to restart (default: unexpected)