{
case SP_COPYING:
/* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_copying, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
{
cb (d->cb_cls, NULL, d->cfg, d, _("`scp' did not complete cleanly.\n"));
return;
}
- GNUNET_OS_process_close (d->proc);
+ GNUNET_OS_process_close (d->proc_arm_copying);
+ d->proc_arm_copying = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Successfully copied configuration file.\n");
d->phase = SP_COPIED;
/* Start create hostkey process if we don't already know the peer identity! */
if (GNUNET_NO == d->have_hostkey)
{
+ GNUNET_assert (NULL == d->proc_arm_peerinfo);
d->pipe_stdout = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_YES);
if (d->pipe_stdout == NULL)
{
"Starting `%s', with command `%s %s %s %s'.\n",
"gnunet-peerinfo", "gnunet-peerinfo", "-c", d->cfgfile,
"-sq");
- d->proc =
+ d->proc_arm_peerinfo =
GNUNET_OS_start_process (GNUNET_YES, NULL, d->pipe_stdout, "gnunet-peerinfo",
"gnunet-peerinfo", "-c", d->cfgfile, "-sq",
NULL);
d->cfgfile, "-sq");
if (d->ssh_port_str == NULL)
{
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh",
+ d->proc_arm_peerinfo = GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
}
else
{
- d->proc =
+ d->proc_arm_peerinfo =
GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh", "-p",
d->ssh_port_str,
#if !DEBUG_TESTING
GNUNET_DISK_pipe_close_end (d->pipe_stdout, GNUNET_DISK_PIPE_END_WRITE);
GNUNET_free (dst);
}
- if (NULL == d->proc)
+ if (NULL == d->proc_arm_peerinfo)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not start `%s' process to create hostkey.\n"),
d->cb = NULL;
GNUNET_DISK_pipe_close (d->pipe_stdout);
d->pipe_stdout = NULL;
- (void) GNUNET_OS_process_kill (d->proc, SIGKILL);
- GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc));
- GNUNET_OS_process_close (d->proc);
- d->proc = NULL;
+ (void) GNUNET_OS_process_kill (d->proc_arm_peerinfo, SIGKILL);
+ GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc_arm_peerinfo));
+ GNUNET_OS_process_close (d->proc_arm_peerinfo);
+ d->proc_arm_peerinfo = NULL;
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d, _("Failed to get hostkey!\n"));
return;
d->shortname = GNUNET_strdup (GNUNET_i2s (&d->id));
GNUNET_DISK_pipe_close (d->pipe_stdout);
d->pipe_stdout = NULL;
- (void) GNUNET_OS_process_kill (d->proc, SIGKILL);
- GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc));
- GNUNET_OS_process_close (d->proc);
- d->proc = NULL;
+ (void) GNUNET_OS_process_kill (d->proc_arm_peerinfo, SIGKILL);
+ GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc_arm_peerinfo));
+ GNUNET_OS_process_close (d->proc_arm_peerinfo);
+ d->proc_arm_peerinfo = NULL;
d->have_hostkey = GNUNET_YES;
if (d->hostkey_callback != NULL)
{
break;
case SP_TOPOLOGY_SETUP: /* Indicates topology setup has completed! */
/* start GNUnet on remote host */
+ fprintf (stderr, "Starting\n");
if (NULL == d->hostname)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting `%s', with command `%s %s %s %s %s %s'.\n",
"gnunet-arm", "gnunet-arm", "-c", d->cfgfile, "-L", "DEBUG",
"-s");
- d->proc =
+ d->proc_arm_start =
GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", "-c",
d->cfgfile,
"-L", "DEBUG",
"-L", "DEBUG", "-s", "-q");
if (d->ssh_port_str == NULL)
{
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
+ d->proc_arm_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
else
{
- d->proc =
+ d->proc_arm_start =
GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", "-p",
d->ssh_port_str,
#if !DEBUG_TESTING
}
GNUNET_free (dst);
}
- if (NULL == d->proc)
+ if (NULL == d->proc_arm_start)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not start `%s' process to start GNUnet.\n"),
d);
break;
case SP_START_ARMING:
- if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_start, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
{
}
GNUNET_free_non_null (d->hostname);
GNUNET_free_non_null (d->username);
- GNUNET_free (d->proc);
-// GNUNET_free (d); // FIXME (could this leak)
+ GNUNET_free (d->proc_arm_start);
+ d->proc_arm_start = NULL;
d->hostname = NULL; // Quick hack to avoid crashing (testing need to be
d->cfg = NULL; // overhauled anyway, and the error managing is
+ // GNUNET_free (d); // FIXME (could this leak)
// pretty broken anyway.
return;
}
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully started `%s'.\n",
"gnunet-arm");
- GNUNET_free (d->proc);
+ GNUNET_free (d->proc_arm_start);
+ d->proc_arm_start = NULL;
d->phase = SP_START_CORE;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling CORE_connect\n");
/* Fall through */
break;
case SP_SERVICE_START:
/* confirm gnunet-arm exited */
- if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_srv_start, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
{
break;
case SP_SERVICE_SHUTDOWN_START:
/* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_srv_stop, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
{
d->dead_cb (d->dead_cb_cls, NULL);
break;
case SP_SHUTDOWN_START:
- /* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
+ /* confirm copying complete !??? */
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_stop, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
{
GNUNET_free_non_null (d->hostname);
GNUNET_free_non_null (d->username);
GNUNET_free_non_null (d->shortname);
- GNUNET_free_non_null (d->proc);
- d->proc = NULL;
+ // GNUNET_free_non_null (d->proc); // !? FIXME
+ // d->proc_arm_stop = NULL;
GNUNET_free (d);
return;
}
GNUNET_free_non_null (d->hostname);
GNUNET_free_non_null (d->username);
GNUNET_free_non_null (d->shortname);
- GNUNET_free_non_null (d->proc);
- d->proc = NULL;
+ // GNUNET_free_non_null (d->proc); // !? FIXME!
+ // d->proc = NULL; // !? FIXME!
GNUNET_free (d);
return;
}
GNUNET_free_non_null (d->hello);
d->hello = NULL;
GNUNET_free_non_null (d->shortname);
- GNUNET_free_non_null (d->proc);
- d->proc = NULL;
+ // GNUNET_free_non_null (d->proc); // !? FIXME
+ // d->proc = NULL; // !? FIXME!
d->shortname = NULL;
if (d->churn == GNUNET_NO)
GNUNET_free (d);
break;
case SP_CONFIG_UPDATE:
/* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_copying, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) /* FIXME: config update should take timeout parameter! */
{
else
arg = GNUNET_strdup (d->hostname);
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
+ d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting gnunet-arm with config `%s' locally.\n", d->cfgfile);
- d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
+ d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
#endif
else
arg = GNUNET_strdup (d->hostname);
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
+ d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting gnunet-arm with config `%s' locally.\n", d->cfgfile);
- d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
+ d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
#endif
GNUNET_free (baseservicehome);
if (ret->ssh_port_str == NULL)
{
- ret->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r",
+ ret->proc_arm_copying = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r",
#if !DEBUG_TESTING
"-q",
#endif
}
else
{
- ret->proc =
+ ret->proc_arm_copying =
GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r", "-P",
ret->ssh_port_str,
#if !DEBUG_TESTING
servicehome, arg, NULL);
}
GNUNET_free (arg);
- if (NULL == ret->proc)
+ if (NULL == ret->proc_arm_copying)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_
d->phase = SP_START_ARMING;
/* Check if this is a local or remote process */
+ fprintf (stderr, "Stopping\n");
if (NULL != d->hostname)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
else
arg = GNUNET_strdup (d->hostname);
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
+ d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
- d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
+ d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
#endif
GNUNET_asprintf (&arg, "%s@%s", d->username, d->hostname);
else
arg = GNUNET_strdup (d->hostname);
-
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
+
+ fprintf (stderr, "Stopping\n");
+ d->proc_arm_srv_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
- d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
+ d->proc_arm_srv_stop = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
#endif
d->th = NULL;
}
/* Check if this is a local or remote process */
+ fprintf (stderr, "Stopping\n");
if (NULL != d->hostname)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
else
arg = GNUNET_strdup (d->hostname);
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
+ d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "gnunet-arm", "gnunet-arm",
+ d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "gnunet-arm", "gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
#endif
"-c", d->cfgfile, "-e", "-q", "-T",
GNUNET_TIME_relative_to_string (timeout),
del_arg, NULL);
- GNUNET_assert (NULL != d->proc);
+ GNUNET_assert (NULL != d->proc_arm_stop);
}
GNUNET_free_non_null (del_arg);
GNUNET_asprintf (&arg, "%s@%s:%s", d->username, d->hostname, d->cfgfile);
else
GNUNET_asprintf (&arg, "%s:%s", d->hostname, d->cfgfile);
- d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp",
+ d->proc_arm_copying = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp",
#if !DEBUG_TESTING
"-q",
#endif
d->cfgfile, arg, NULL);
GNUNET_free (arg);
- if (NULL == d->proc)
+ if (NULL == d->proc_arm_copying)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not start `%s' process to copy configuration file.\n"),