You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ig...@apache.org on 2014/01/20 15:44:56 UTC
[3/3] git commit: remove references to hardRestart() and related
functions
remove references to hardRestart() and related functions
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b5c79b2d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b5c79b2d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b5c79b2d
Branch: refs/heads/TS-645-hard-restart
Commit: b5c79b2debff05ab6415147e1e6aea07221a5e5c
Parents: 7f4ea4d
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Jan 20 15:41:50 2014 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Jan 20 15:41:50 2014 +0100
----------------------------------------------------------------------
cmd/traffic_shell/CliCreateCommands.cc | 3 --
cmd/traffic_shell/CliMgmtUtils.cc | 1 -
cmd/traffic_shell/ConfigCmd.cc | 39 -----------------
cmd/traffic_shell/ConfigCmd.h | 2 -
mgmt/api/APITestCliRemote.cc | 17 --------
mgmt/api/CoreAPI.cc | 16 -------
mgmt/api/CoreAPI.h | 1 -
mgmt/api/CoreAPIRemote.cc | 65 -----------------------------
mgmt/api/INKMgmtAPI.cc | 16 -------
mgmt/api/INKMgmtAPIStub.cc | 6 ---
mgmt/api/include/mgmtapi.h | 8 ----
11 files changed, 174 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/cmd/traffic_shell/CliCreateCommands.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliCreateCommands.cc b/cmd/traffic_shell/CliCreateCommands.cc
index cd57f44..7d1ae5e 100644
--- a/cmd/traffic_shell/CliCreateCommands.cc
+++ b/cmd/traffic_shell/CliCreateCommands.cc
@@ -133,9 +133,6 @@ CliCreateCommands()
createCommand("config:stop", Cmd_ConfigStop, NULL, CLI_COMMAND_EXTERNAL, "config:stop", "Stop proxy software");
- createCommand("config:hard-restart", Cmd_ConfigHardRestart, NULL, CLI_COMMAND_EXTERNAL,
- "config:hard-restart", "Perform Hard Restart of all software components");
-
createCommand("config:restart", Cmd_ConfigRestart, CmdArgs_ConfigRestart, CLI_COMMAND_EXTERNAL,
"config:restart [cluster]", "Perform Restart of proxy software");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/cmd/traffic_shell/CliMgmtUtils.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliMgmtUtils.cc b/cmd/traffic_shell/CliMgmtUtils.cc
index 1b3ee93..c00024b 100644
--- a/cmd/traffic_shell/CliMgmtUtils.cc
+++ b/cmd/traffic_shell/CliMgmtUtils.cc
@@ -275,7 +275,6 @@ Cli_ConfigEnactChanges(TSActionNeedT action_need)
Cli_Debug("Cli_ConfigEnactChanges: TS_ACTION_SHUTDOWN\n");
Cli_Printf("\nHard Restart required.\n"
" Change will take effect after next Hard Restart.\n"
- " Use the \"config:hard-restart\" command to restart now.\n\n");
break;
case TS_ACTION_RESTART:
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/cmd/traffic_shell/ConfigCmd.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ConfigCmd.cc b/cmd/traffic_shell/ConfigCmd.cc
index 2bdda42..4e61cc5 100644
--- a/cmd/traffic_shell/ConfigCmd.cc
+++ b/cmd/traffic_shell/ConfigCmd.cc
@@ -459,45 +459,6 @@ Cmd_ConfigStop(ClientData clientData, Tcl_Interp * interp, int argc, const char
}
////////////////////////////////////////////////////////////////
-// Cmd_ConfigHardRestart
-//
-// This is the callback function for the "config:hard-restart" command.
-//
-// Parameters:
-// clientData -- information about parsed arguments
-// interp -- the Tcl interpreter
-// argc -- number of command arguments
-// argv -- the command arguments
-//
-int
-Cmd_ConfigHardRestart(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
-{
- /* call to processArgForCommand must appear at the beginning
- * of each command's callback function
- */
- if (processArgForCommand(interp, argc, argv) != CLI_OK) {
- return CMD_ERROR;
- }
-
- if (processHelpCommand(argc, argv) == CLI_OK)
- return CMD_OK;
- if (cliCheckIfEnabled("config:hard-restart") == CLI_ERROR) {
- return CMD_ERROR;
- }
-
- cli_cmdCallbackInfo *cmdCallbackInfo;
-
- cmdCallbackInfo = (cli_cmdCallbackInfo *) clientData;
- Cli_Debug("Cmd_ConfigHardRestart argc %d\n", argc);
-
- if (argc == 1) {
- return (TSHardRestart());
- }
- Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
- return CMD_ERROR;
-}
-
-////////////////////////////////////////////////////////////////
// Cmd_ConfigRestart
//
// This is the callback function for the "config:restart" command.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/cmd/traffic_shell/ConfigCmd.h
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ConfigCmd.h b/cmd/traffic_shell/ConfigCmd.h
index 84456fc..38d3d74 100644
--- a/cmd/traffic_shell/ConfigCmd.h
+++ b/cmd/traffic_shell/ConfigCmd.h
@@ -354,8 +354,6 @@ int Cmd_ConfigStart(ClientData clientData, Tcl_Interp * interp, int argc, const
//
int Cmd_ConfigStop(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-int Cmd_ConfigHardRestart(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-
int Cmd_ConfigRestart(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
int CmdArgs_ConfigRestart();
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/APITestCliRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/APITestCliRemote.cc b/mgmt/api/APITestCliRemote.cc
index 57f6ebc..0b1318e 100644
--- a/mgmt/api/APITestCliRemote.cc
+++ b/mgmt/api/APITestCliRemote.cc
@@ -39,7 +39,6 @@
* eg. start, start:hostdb, start:all
* stop: turns Proxy off
* restart: restarts Traffic Manager (Traffic Cop must be running)
- * kill_TC: restarts Traffic Cop (and TM and TS too)
*
* File operations:
* ---------------
@@ -937,20 +936,6 @@ reconfigure()
print_err("reconfigure", ret);
}
-// currently does nothing
-void
-hard_restart()
-{
- TSError ret;
-
- printf("[hard_restart]Restart Traffic Cop\n");
- if ((ret = TSHardRestart()) != TS_ERR_OKAY)
- printf("[TSHardRestart] FAILED\n");
-
- print_err("hard_restart", ret);
-}
-
-
/* ------------------------------------------------------------------------
* test_action_need
* ------------------------------------------------------------------------
@@ -2369,8 +2354,6 @@ runInteractive()
restart();
} else if (strstr(buf, "reconfig")) {
reconfigure();
- } else if (strstr(buf, "kill_TC")) {
- hard_restart();
} else if (strstr(buf, "records")) {
test_records();
} else if (strstr(buf, "err_recs")) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/CoreAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index 370d6a7..76d76d1 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -262,19 +262,6 @@ Restart(bool cluster)
}
/*-------------------------------------------------------------------------
- * HardRestart
- *-------------------------------------------------------------------------
- * Cannot be executed locally since it requires a restart of Traffic Cop.
- * So just return TS_ERR_FAIL. Should only be called by remote API clients.
- */
-TSError
-HardRestart()
-{
- return TS_ERR_FAIL;
-}
-
-
-/*-------------------------------------------------------------------------
* Bouncer
*-------------------------------------------------------------------------
* Bounces traffic_server process(es).
@@ -396,9 +383,6 @@ determine_action_need(const char *rec_name)
case RECU_RESTART_TM: // requires TM/TS restart
return TS_ACTION_RESTART;
- case RECU_RESTART_TC: // requires TC/TM/TS restart
- return TS_ACTION_SHUTDOWN;
-
default: // shouldn't get here actually
return TS_ACTION_UNDEFINED;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/CoreAPI.h
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.h b/mgmt/api/CoreAPI.h
index dfd2cc1..67f740c 100644
--- a/mgmt/api/CoreAPI.h
+++ b/mgmt/api/CoreAPI.h
@@ -53,7 +53,6 @@ TSError ProxyStateSet(TSProxyStateT state, TSCacheClearT clear);
TSError Reconfigure(); // TS reread config files
TSError Restart(bool cluster); //restart TM
-TSError HardRestart(); //restart traffic_cop
TSError Bounce(bool cluster); //restart traffic_server
/***************************************************************************
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/CoreAPIRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPIRemote.cc b/mgmt/api/CoreAPIRemote.cc
index 6c0ecc3..7ef8d61 100644
--- a/mgmt/api/CoreAPIRemote.cc
+++ b/mgmt/api/CoreAPIRemote.cc
@@ -60,7 +60,6 @@ TSError send_and_parse_basic(OpType op);
TSError send_and_parse_list(OpType op, LLQ * list);
TSError send_and_parse_name(OpType op, char *name);
TSError mgmt_record_set(const char *rec_name, const char *rec_val, TSActionNeedT * action_need);
-bool start_binary(const char *abs_bin_path);
// global variables
// need to store the thread id associated with socket_test_thread
@@ -193,39 +192,6 @@ mgmt_record_set(const char *rec_name, const char *rec_val, TSActionNeedT * actio
}
-/*-------------------------------------------------------------------------
- * start_binary
- *-------------------------------------------------------------------------
- * helper function which calls the executable specified by abs_bin_path;
- * used by HardRestart to call the stop/start_traffic_server scripts
- * Output: returns false if fail, true if successful
- */
-bool
-start_binary(const char *abs_bin_path)
-{
- TSDiags(TS_DIAG_NOTE, "[start_binary] abs_bin_path = %s", abs_bin_path);
- // before doing anything, check for existence of binary and its execute
- // permissions
- if (access(abs_bin_path, F_OK) < 0) {
- // ERROR: can't find binary
- TSDiags(TS_DIAG_ERROR, "Cannot find executable %s", abs_bin_path);
- return false;
- }
- // binary exists, check permissions
- else if (access(abs_bin_path, R_OK | X_OK) < 0) {
- // ERROR: doesn't have proper permissions
- TSDiags(TS_DIAG_ERROR, "Cannot execute %s", abs_bin_path);
- return false;
- }
-
- if (system(abs_bin_path) == -1) {
- TSDiags(TS_DIAG_ERROR, "Cannot system(%s)", abs_bin_path);
- return false;
- }
-
- return true;
-}
-
/***************************************************************************
* SetUp Operations
@@ -416,37 +382,6 @@ Restart(bool cluster)
/*-------------------------------------------------------------------------
- * HardRestart
- *-------------------------------------------------------------------------
- * Restarts Traffic Cop by using the stop_traffic_server, start_traffic_server script
- */
-TSError
-HardRestart()
-{
- char start_path[1024];
- char stop_path[1024];
-
- if (!Layout::get() || !Layout::get()->bindir)
- return TS_ERR_FAIL;
- // determine the path of where start and stop TS scripts stored
- TSDiags(TS_DIAG_NOTE, "Root Directory: %s", Layout::get()->bindir);
-
- Layout::relative_to(start_path, sizeof(start_path), Layout::get()->bindir, "start_traffic_server");
- Layout::relative_to(stop_path, sizeof(stop_path), Layout::get()->bindir, "stop_traffic_server");
-
- TSDiags(TS_DIAG_NOTE, "[HardRestart] start_path = %s", start_path);
- TSDiags(TS_DIAG_NOTE, "[HardRestart] stop_path = %s", stop_path);
-
- if (!start_binary(stop_path)) // call stop_traffic_server script
- return TS_ERR_FAIL;
-
- if (!start_binary(start_path)) // call start_traffic_server script
- return TS_ERR_FAIL;
-
- return TS_ERR_OKAY;
-}
-
-/*-------------------------------------------------------------------------
* Bounce
*-------------------------------------------------------------------------
* Restart the traffic_server process(es) only.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/INKMgmtAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index ac9a139..07c7636 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -1767,19 +1767,6 @@ TSRestart(bool cluster)
return Restart(cluster);
}
-/* TSHardRestart: a traffic_cop restart (restarts TM and TS),
- * essentially does a "start_traffic_server"/"stop_traffic_server" sequence
- * Input: <none>
- * Output: TSError
- * Note: only for remote API clients
- */
-/* CAN ONLY BE IMPLEMENTED ON THE REMOTE SIDE !!! */
-tsapi TSError
-TSHardRestart()
-{
- return HardRestart(); // should return TS_ERR_FAIL
-}
-
/* TSActionDo: based on TSActionNeedT, will take appropriate action
* Input: action - action that needs to be taken
* Output: TSError
@@ -1790,9 +1777,6 @@ TSActionDo(TSActionNeedT action)
TSError ret;
switch (action) {
- case TS_ACTION_SHUTDOWN:
- ret = HardRestart();
- break;
case TS_ACTION_RESTART:
ret = Restart(true); // cluster wide by default?
break;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/INKMgmtAPIStub.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPIStub.cc b/mgmt/api/INKMgmtAPIStub.cc
index adbbaf9..36219cd 100644
--- a/mgmt/api/INKMgmtAPIStub.cc
+++ b/mgmt/api/INKMgmtAPIStub.cc
@@ -541,12 +541,6 @@ INKRestart(bool cluster)
}
inkapi INKError
-INKHardRestart()
-{
- return INK_ERR_OKAY;
-}
-
-inkapi INKError
INKActionDo(INKActionNeedT action)
{
return INK_ERR_OKAY;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c79b2d/mgmt/api/include/mgmtapi.h
----------------------------------------------------------------------
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index c562733..7672c19 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -152,7 +152,6 @@ extern "C"
typedef enum
{
- TS_ACTION_SHUTDOWN, /* change requires user to stop then start the Traffic Server and Manager (restart Traffic Cop) */
TS_ACTION_RESTART, /* change requires restart Traffic Server and Traffic Manager */
TS_ACTION_DYNAMIC, /* change is already made in function call */
TS_ACTION_RECONFIGURE, /* change requires TS to reread configuration files */
@@ -1007,13 +1006,6 @@ extern "C"
*/
tsapi TSError TSRestart(bool cluster);
-/* TSHardRestart: stops and then starts Traffic Server
- * Input: <none>
- * Output: TSError
- * Note: only for remote API clients
- */
- tsapi TSError TSHardRestart();
-
/* TSActionDo: based on TSActionNeedT, will take appropriate action
* Input: action - action that needs to be taken
* Output: TSError