Commit c2319c8d authored by Leigh B. Stoller's avatar Leigh B. Stoller

Attempt to fix the problem with loghole and ops program agent files

getting deleted.
parent 89c9208b
...@@ -270,7 +270,8 @@ my @agent_command_options = ("-u", $user, "-d", "-e", "$pid/$eid", ...@@ -270,7 +270,8 @@ my @agent_command_options = ("-u", $user, "-d", "-e", "$pid/$eid",
"-v", "ops", "-v", "ops",
"-c", "$EXPDIR/tbdata/program_agents", "-c", "$EXPDIR/tbdata/program_agents",
"-f", "$EXPDIR/tbdata/environment", "-f", "$EXPDIR/tbdata/environment",
"-o", "$EXPDIR/logs/ops"); "-l", "$EXPDIR/logs/progagent.debug",
"-o", "$EXPDIR/ops");
# #
# We want to catch these programs if they exit abnormally. # We want to catch these programs if they exit abnormally.
......
...@@ -908,13 +908,17 @@ def do_show(args): ...@@ -908,13 +908,17 @@ def do_show(args):
# @param *args The list of directories to sync. # @param *args The list of directories to sync.
# @retval The exit status of the rsync command-line. # @retval The exit status of the rsync command-line.
# #
def rsync(host, base, dlpath, paths = ["/"], port = None, output = False, def rsync(host, base, dlpath = None, paths = ["/"], port = None,
delay = 0, as_root = False): output = False, delay = 0, as_root = False, relative = True):
global RSYNC, HOME, DEBUG global RSYNC, HOME, DEBUG
retval = 0 retval = 0
for path in paths: for path in paths:
fullpath = os.path.join("", base, path[1:], "") if relative == True:
fullpath = os.path.join("", base, path[1:], "")
else:
fullpath = base
pass
try: try:
os.makedirs(fullpath) os.makedirs(fullpath)
pass pass
...@@ -923,8 +927,10 @@ def rsync(host, base, dlpath, paths = ["/"], port = None, output = False, ...@@ -923,8 +927,10 @@ def rsync(host, base, dlpath, paths = ["/"], port = None, output = False,
cmd = [RSYNC, cmd = [RSYNC,
"-rtgoDlz", "-rtgoDlz",
"-v", # XXX "-v", # XXX
"--copy-unsafe-links", "--copy-unsafe-links"]
"--include-from=" + dlpath] if dlpath != None:
cmd.append("--include-from=" + dlpath)
pass
if VERBOSITY > VERBOSITY_HUMAN: if VERBOSITY > VERBOSITY_HUMAN:
cmd.append("-v") cmd.append("-v")
pass pass
...@@ -1220,6 +1226,8 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False): ...@@ -1220,6 +1226,8 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
delete_dir = False delete_dir = False
logdir = os.path.join(EXPDIR_FMT % { "PID" : PID, "EID" : EID }, "logs") logdir = os.path.join(EXPDIR_FMT % { "PID" : PID, "EID" : EID }, "logs")
# Special dir for local program agent (or other stuff).
opsdir = os.path.join(EXPDIR_FMT % { "PID" : PID, "EID" : EID }, "ops")
standard_logholes = True standard_logholes = True
snapshot_traces = False snapshot_traces = False
...@@ -1377,6 +1385,22 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False): ...@@ -1377,6 +1385,22 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
pass pass
pass pass
#
# Do the local ops directory first.
#
if os.path.exists(opsdir):
if mode == "sync":
pid = rsync("localhost", logdir,
paths = [opsdir], output = True,
relative = False)
pass
elif mode == "clean":
pid = rmstar("localhost", None, 0, False, opsdir + "/*")
pass
else:
assert 0
pass
known_nodes = sets.Set(node_list) & (phosts | vhosts) known_nodes = sets.Set(node_list) & (phosts | vhosts)
unknown_nodes = known_nodes ^ sets.Set(node_list) unknown_nodes = known_nodes ^ sets.Set(node_list)
...@@ -1433,7 +1457,7 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False): ...@@ -1433,7 +1457,7 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
pass pass
if mode == "sync": if mode == "sync":
pid = rsync(phost, os.path.join(logdir, vhost), pid = rsync(phost, os.path.join(logdir, vhost),
dlhandle.name, dlpath = dlhandle.name,
port = ssh_data[phost].get("port", None), port = ssh_data[phost].get("port", None),
output = True, output = True,
delay = delay, delay = delay,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment