aboutsummaryrefslogtreecommitdiff
path: root/src/startstop.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2018-11-17 17:54:07 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2018-11-17 17:59:40 +0200
commit3e2360d383d8e7503a8afe07291ab8c0b1182a14 (patch)
tree69725e6a523701dd297a7bc5d228dac43371b32d /src/startstop.c
parent966cc92ffcc7e5d070103d33f605bc1691229022 (diff)
downloadeclat-3e2360d383d8e7503a8afe07291ab8c0b1182a14.tar.gz
eclat-3e2360d383d8e7503a8afe07291ab8c0b1182a14.tar.bz2
Implement the terminate-instances command
* TODO: Update. * doc/Makefile.inc: Add new files. * doc/eclat-mkinst.1: Mention the terminate command. * doc/eclat-terminate.1: New file. * etc/Makefile.am: Add new files. * etc/terminate-instances.fln: New file. * src/eclat.c (cmdtab): Register new command. * src/eclat.h (eclat_terminate_instances): New proto. * src/startstop.c (eclat_terminate_instances): New function. * tests/Makefile.am: Add new test. * tests/testsuite.at: Likewise. * tests/terminate-instances.at: New test.
Diffstat (limited to 'src/startstop.c')
-rw-r--r--src/startstop.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/startstop.c b/src/startstop.c
index 2460682..78c581c 100644
--- a/src/startstop.c
+++ b/src/startstop.c
@@ -41,13 +41,12 @@ start_stop_instance(eclat_command_env_t *env, int argc, char **argv)
bend = buf + strlen(buf);
bs = sizeof(buf) - strlen(buf);
for (i = 0; i < argc; i++) {
snprintf(bend, bs, "%lu", (unsigned long)(i + 1));
eclat_request_add_param(q, buf, argv[i]);
}
-
return 0;
}
int
eclat_start_instance(eclat_command_env_t *env, int argc, char **argv)
{
@@ -87,6 +86,19 @@ eclat_reboot_instance(eclat_command_env_t *env, int argc, char **argv)
"Reboot named instances",
argc, argv, &i);
debug(ECLAT_DEBCAT_MAIN, 1, ("rebooting instances"));
return start_stop_instance(env, argc - i, argv + i);
}
+
+int
+eclat_terminate_instances(eclat_command_env_t *env, int argc, char **argv)
+{
+ int i;
+
+ parse_options(env->cmd,
+ "Terminate named instances",
+ argc, argv, &i);
+
+ debug(ECLAT_DEBCAT_MAIN, 1, ("terminate instances"));
+ return start_stop_instance(env, argc - i, argv + i);
+}

Return to:

Send suggestions and report system problems to the System administrator.