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/21 00:16:27 UTC

[1/3] git commit: TS-645 remove calls in which hard restart is used

Updated Branches:
  refs/heads/TS-645 [created] fa29002bc


TS-645 remove calls in which hard restart is used

it's hard to tell what this is useful for when you have upstart,
systemd, SMF and others controling.
Aside from being implemented poorly via system(3), it's an API breakage,
which is why we're putting it into 5.0.x


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a17a7690
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a17a7690
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a17a7690

Branch: refs/heads/TS-645
Commit: a17a7690313739d2f43cf551c6b661a376e138c7
Parents: 4db27ec
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Jan 20 23:05:26 2014 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Tue Jan 21 00:09:16 2014 +0100

----------------------------------------------------------------------
 cmd/traffic_shell/CliCreateCommands.cc |  3 --
 cmd/traffic_shell/CliMgmtUtils.cc      |  3 +-
 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                 | 17 +-------
 mgmt/api/INKMgmtAPIStub.cc             |  6 ---
 mgmt/api/include/mgmtapi.h             |  7 ----
 11 files changed, 2 insertions(+), 174 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a17a7690/cmd/traffic_shell/CliCreateCommands.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliCreateCommands.cc b/cmd/traffic_shell/CliCreateCommands.cc
index 5a22207..2777301 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/a17a7690/cmd/traffic_shell/CliMgmtUtils.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliMgmtUtils.cc b/cmd/traffic_shell/CliMgmtUtils.cc
index 222e334..aee589d 100644
--- a/cmd/traffic_shell/CliMgmtUtils.cc
+++ b/cmd/traffic_shell/CliMgmtUtils.cc
@@ -274,8 +274,7 @@ Cli_ConfigEnactChanges(TSActionNeedT action_need)
   case TS_ACTION_SHUTDOWN:
     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");
+               "  Change will take effect after next Hard Restart.\n");
     break;
 
   case TS_ACTION_RESTART:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a17a7690/cmd/traffic_shell/ConfigCmd.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ConfigCmd.cc b/cmd/traffic_shell/ConfigCmd.cc
index a40da20..ee17181 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/a17a7690/cmd/traffic_shell/ConfigCmd.h
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ConfigCmd.h b/cmd/traffic_shell/ConfigCmd.h
index 42ed681..520d5f4 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/a17a7690/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/a17a7690/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/a17a7690/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/a17a7690/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/a17a7690/mgmt/api/INKMgmtAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index ac9a139..0512069 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;
@@ -1802,6 +1786,7 @@ TSActionDo(TSActionNeedT action)
   case TS_ACTION_DYNAMIC:
     /* do nothing - change takes effect immediately */
     return TS_ERR_OKAY;
+  case TS_ACTION_SHUTDOWN:
   default:
     return TS_ERR_FAIL;
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a17a7690/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/a17a7690/mgmt/api/include/mgmtapi.h
----------------------------------------------------------------------
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index c562733..5ca856d 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -1007,13 +1007,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


[3/3] git commit: TS-645 remove StopTrafficServer() and StartTrafficServer() from traffic_shell

Posted by ig...@apache.org.
TS-645 remove StopTrafficServer() and StartTrafficServer() from traffic_shell


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fa29002b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fa29002b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fa29002b

Branch: refs/heads/TS-645
Commit: fa29002bc2743128c6b911c23fe72012cdad6f7d
Parents: ff35aa2
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Jan 20 15:22:21 2014 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Tue Jan 21 00:14:10 2014 +0100

----------------------------------------------------------------------
 cmd/traffic_shell/CliMgmtUtils.cc               | 37 --------------------
 cmd/traffic_shell/CliMgmtUtils.h                |  2 --
 cmd/traffic_shell/cli_detailed_command_list.txt | 18 ----------
 3 files changed, 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fa29002b/cmd/traffic_shell/CliMgmtUtils.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliMgmtUtils.cc b/cmd/traffic_shell/CliMgmtUtils.cc
index aee589d..62b5297 100644
--- a/cmd/traffic_shell/CliMgmtUtils.cc
+++ b/cmd/traffic_shell/CliMgmtUtils.cc
@@ -556,43 +556,6 @@ GetTSDirectory(char *ts_path, size_t ts_path_len)
 }
 
 int
-StopTrafficServer()
-{
-  char ts_path[PATH_NAME_MAX + 1];
-  char stop_ts[1024];
-
-  if (GetTSDirectory(ts_path,sizeof(ts_path))) {
-    return CLI_ERROR;
-  }
-  snprintf(stop_ts, sizeof(stop_ts), "%s/stop_traffic_server", ts_path);
-  if (system(stop_ts) == -1)
-    return CLI_ERROR;
-
-  return 0;
-}
-
-int
-StartTrafficServer()
-{
-  char ts_path[PATH_NAME_MAX + 1];
-  char start_ts[1024];
-
-  if (GetTSDirectory(ts_path,sizeof(ts_path))) {
-    return CLI_ERROR;
-  }
-  // root user should start_traffic_shell as inktomi user
-  if (getuid() == 0) {
-    snprintf(start_ts, sizeof(start_ts), "/bin/su - inktomi -c \"%s/start_traffic_server\"", ts_path);
-  } else {
-    snprintf(start_ts, sizeof(start_ts), "%s/start_traffic_server", ts_path);
-  }
-  if (system(start_ts) == -1)
-    return CLI_ERROR;
-
-  return 0;
-}
-
-int
 Cli_CheckPluginStatus(TSString plugin)
 {
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fa29002b/cmd/traffic_shell/CliMgmtUtils.h
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliMgmtUtils.h b/cmd/traffic_shell/CliMgmtUtils.h
index 3798f70..17357c4 100644
--- a/cmd/traffic_shell/CliMgmtUtils.h
+++ b/cmd/traffic_shell/CliMgmtUtils.h
@@ -147,6 +147,4 @@ int cliCheckIfEnabled(const char *command);
 
 int GetTSDirectory(char *ts_path, size_t ts_path_len);
 
-int StopTrafficServer();
-int StartTrafficServer();
 int Cli_CheckPluginStatus(TSString plugin);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fa29002b/cmd/traffic_shell/cli_detailed_command_list.txt
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/cli_detailed_command_list.txt b/cmd/traffic_shell/cli_detailed_command_list.txt
index 54b2776..c297a95 100644
--- a/cmd/traffic_shell/cli_detailed_command_list.txt
+++ b/cmd/traffic_shell/cli_detailed_command_list.txt
@@ -889,24 +889,6 @@ name			Proxy Name
   config1
   ts#
 
-start			Start Proxy Software
-  syntax: config:start
-  args:   none
-  behavior:  Run start_traffic_server.
-
-  ts# config:start
-  +OK
-  ts#
-
-stop			Stop Proxy Software
-  syntax: config:stop
-  args:   none
-  behavior:  Run stop_traffic_server.
-
-  ts# config:stop
-  +OK
-  ts#
-
 write			Write Upgrade File (IFC file)
   syntax: config:write ifc-head ts-version <ts_version> build-date <date> platform <platform> nodes <no_of_nodes> 
 	  config:write feature <feature-string>


[2/3] git commit: TS-645 remove the functions in which StartTrafficServer() and StopTrafficServer() was referenced

Posted by ig...@apache.org.
TS-645 remove the functions in which StartTrafficServer() and StopTrafficServer() was referenced

the reason we remove those functions (ConfigClock, ConfigDate,
ConfitTime, etc..) is because they are entirely Linux specific, use
hard-coded paths, and assume that our Admins, while clue-less, will know
how to use this undocumented traffic_shell program


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ff35aa24
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ff35aa24
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ff35aa24

Branch: refs/heads/TS-645
Commit: ff35aa24c06da0f7fba684b5a3ba723646182cfc
Parents: a17a769
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Jan 20 15:29:50 2014 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Tue Jan 21 00:14:10 2014 +0100

----------------------------------------------------------------------
 cmd/traffic_shell/CliCreateCommands.cc |   5 -
 cmd/traffic_shell/ConfigCmd.cc         | 377 ----------------------------
 cmd/traffic_shell/ConfigCmd.h          |  26 --
 3 files changed, 408 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ff35aa24/cmd/traffic_shell/CliCreateCommands.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/CliCreateCommands.cc b/cmd/traffic_shell/CliCreateCommands.cc
index 2777301..7d1ae5e 100644
--- a/cmd/traffic_shell/CliCreateCommands.cc
+++ b/cmd/traffic_shell/CliCreateCommands.cc
@@ -147,11 +147,6 @@ CliCreateCommands()
   createCommand("config:remap", Cmd_ConfigRemap, NULL, CLI_COMMAND_EXTERNAL,
                 "config:remap <url>", "Update remap configuration file <url>");
 
-  createCommand("config:clock", Cmd_ConfigClock, CmdArgs_ConfigClock, CLI_COMMAND_EXTERNAL,
-                "config:clock date <mm/dd/yyyy>\n"
-                "config:clock time <hh:mm:ss>\n"
-                "config:clock timezone <number from list | list>", "Configure date, time, timezone");
-
   createCommand("config:security", Cmd_ConfigSecurity, CmdArgs_ConfigSecurity, CLI_COMMAND_EXTERNAL,
                 "config:security <ip-allow | mgmt-allow | admin> <url-config-file>\n"
                 "config:security password", "Update security configuration");

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ff35aa24/cmd/traffic_shell/ConfigCmd.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ConfigCmd.cc b/cmd/traffic_shell/ConfigCmd.cc
index ee17181..4e61cc5 100644
--- a/cmd/traffic_shell/ConfigCmd.cc
+++ b/cmd/traffic_shell/ConfigCmd.cc
@@ -721,90 +721,6 @@ CmdArgs_ConfigPorts()
   return 0;
 }
 
-////////////////////////////////////////////////////////////////
-// Cmd_ConfigClock
-//
-// This is the callback function for the "config:clock" command.
-//
-// Parameters:
-//    clientData -- information about parsed arguments
-//    interp -- the Tcl interpreter
-//    argc -- number of command arguments
-//    argv -- the command arguments
-//
-int
-Cmd_ConfigClock(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;
-
-  int setvar = 0;
-
-  if (cliCheckIfEnabled("config:clock") == CLI_ERROR) {
-    return CMD_ERROR;
-  }
-  Cli_Debug("Cmd_ConfigClock argc %d\n", argc);
-
-  cli_cmdCallbackInfo *cmdCallbackInfo;
-  cli_parsedArgInfo *argtable;
-
-  cmdCallbackInfo = (cli_cmdCallbackInfo *) clientData;
-  argtable = cmdCallbackInfo->parsedArgTable;
-
-  Cli_PrintArg(0, argtable);
-  Cli_PrintArg(1, argtable);
-
-  if (argtable[0].parsed_args != CLI_PARSED_ARGV_END) {
-    switch (argtable[0].parsed_args) {
-    case CMD_CONFIG_DATE:
-      return (ConfigDate(argtable->arg_string));
-    case CMD_CONFIG_TIME:
-      return (ConfigTime(argtable->arg_string));
-    case CMD_CONFIG_TIMEZONE:
-      if (argc == 3) {
-        setvar = 1;
-      }
-      if (argtable[1].parsed_args == CMD_CONFIG_TIMEZONE_LIST) {
-        return (ConfigTimezoneList());
-      } else {
-        return (ConfigTimezone(argtable->arg_int, setvar));
-      }
-    }
-  }
-
-  Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
-  return CMD_ERROR;
-}
-
-////////////////////////////////////////////////////////////////
-// CmdArgs_ConfigClock
-//
-// Register "config:clock" arguments with the Tcl interpreter.
-//
-int
-CmdArgs_ConfigClock()
-{
-  createArgument("date", 1, CLI_ARGV_OPTION_NAME_VALUE,
-                 (char *) NULL, CMD_CONFIG_DATE, "System Date <mm/dd/yyyy>", (char *) NULL);
-
-  createArgument("time", 1, CLI_ARGV_OPTION_NAME_VALUE,
-                 (char *) NULL, CMD_CONFIG_TIME, "System Time <hh:mm:ss>", (char *) NULL);
-
-  createArgument("timezone", 1, CLI_ARGV_OPTION_INT_VALUE,
-                 (char *) NULL, CMD_CONFIG_TIMEZONE, "Time Zone", (char *) NULL);
-
-  createArgument("list", CMD_CONFIG_TIMEZONE, CLI_ARGV_CONSTANT,
-                 (char *) NULL, CMD_CONFIG_TIMEZONE_LIST, "Display Time Zone List", (char *) NULL);
-
-  return 0;
-}
 
 ////////////////////////////////////////////////////////////////
 // Cmd_ConfigSecurity
@@ -2479,299 +2395,6 @@ ConfigRemap(const char *url)
   return (Cli_SetConfigFileFromUrl(TS_FNAME_REMAP, url));
 }
 
-// config date sub-command
-//   used to set or display the system date
-
-int
-ConfigDate(char *datestr)
-{
-
-  if (datestr) {                // set the date
-    Cli_Debug("ConfigDate: set date %s\n", datestr);
-
-    if (getuid() != 0) {
-      Cli_Printf("\nMust be \"root\" user to change the date.\n"
-                 "Use \"config:root\" command to switch to root user.\n");
-      return CLI_ERROR;
-    }
-
-
-    struct tm *mPtr;
-    struct timeval v;
-    struct DateTime t;
-    int yy, mm, dd;
-
-    memset(&v, 0, sizeof(struct timeval));
-    memset(&t, 0, sizeof(struct DateTime));
-
-
-    // add strlen() check to avoid string overflow, so we can disable coverity check here
-    // coverity[secure_coding]
-    if (strlen(datestr) != 10 || sscanf(datestr, "%[0-9]/%[0-9]/%[0-9]", t.str_mm, t.str_dd, t.str_yy) != 3) {
-      Cli_Printf("Error: <date> = mm/dd/yyyy \n");
-      return CLI_ERROR;
-    }
-
-    Cli_Debug("%s-%s-%s\n", t.str_mm, t.str_dd, t.str_yy);
-
-    mm = atoi(t.str_mm);
-    dd = atoi(t.str_dd);
-    yy = atoi(t.str_yy);
-
-    Cli_Debug("%d-%d-%d\n", mm, dd, yy);
-
-    if (!((dd >= 1) && (dd <= 31)
-          && (mm >= 1) && (mm <= 12)
-          && (yy >= 1900) && (yy <= 2100))) {
-      Cli_Printf("Error: Invalid Date Value \n");
-      return CLI_ERROR;
-    }
-
-    if (gettimeofday(&v, NULL)) {
-      Cli_Debug("Error Getting Time \n");
-      return CLI_ERROR;
-    }
-
-    mPtr = localtime((const time_t *)&(v.tv_sec));
-
-    mPtr->tm_mday = dd;
-    mPtr->tm_mon = mm - 1;
-    mPtr->tm_year = yy - 1900;
-    if ((v.tv_sec = mktime(mPtr)) < 0) {
-      Cli_Printf("ERROR: invalid date \n");
-      return CLI_ERROR;
-    }
-
-    Cli_Printf("Stopping Proxy software while changing clock settings.\n");
-
-    StopTrafficServer();
-
-    if (settimeofday(&v, NULL) == -1) {
-      Cli_Printf("Error: could not update date \n");
-      StartTrafficServer();
-      return CLI_ERROR;
-    }
-    if (system("/sbin/hwclock --systohc --utc") != 0) {
-      Cli_Error("ERROR: Unable to set hardware clock.\n");
-      exit(1);
-    }
-    StartTrafficServer();
-  }
-
-
-  Cli_Debug("Config:clock: get date\n");
-  if (system("date '+DATE: %m/%d/%Y'") == -1)
-    return CLI_ERROR;
-
-  return CLI_OK;
-
-}
-
-
-// config time sub-command
-//   used to set or display the system time
-int
-ConfigTime(char *timestr)
-{
-
-  if (timestr) {                // set the time
-    Cli_Debug("ConfigTime: set time %s\n", timestr);
-    if (getuid() != 0) {
-      Cli_Printf("\nMust be \"root\" user to change the time.\n"
-                 "Use \"config:root\" command to switch to root user.\n");
-      return CLI_ERROR;
-    }
-
-    struct tm *mPtr;
-    struct timeval v;
-    struct DateTime t;
-    int hour, min, sec;
-
-    memset(&v, 0, sizeof(struct timeval));
-    memset(&t, 0, sizeof(struct DateTime));
-
-    // add strlen() check to avoid string overflow, so we can disable coverity check here
-    // coverity[secure_coding]
-    if (strlen(timestr) != 8 || sscanf(timestr, "%[0-9]:%[0-9]:%[0-9]", t.str_hh, t.str_min, t.str_ss) != 3) {
-      Cli_Printf("Error: <time> = hh:mm:ss \n");
-      return CLI_ERROR;
-    }
-
-    Cli_Debug("%s-%s-%s\n", t.str_hh, t.str_min, t.str_ss);
-
-    hour = atoi(t.str_hh);
-    min = atoi(t.str_min);
-    sec = atoi(t.str_ss);
-    Cli_Debug("%d-%d-%d\n", hour, min, sec);
-
-    if (!((hour >= 0) && (hour <= 23)
-          && (min >= 0) && (min <= 59)
-          && (sec >= 0) && (sec <= 59))) {
-      Cli_Printf("ERROR: Invalid Time Value \n");
-      return CLI_ERROR;
-    }
-
-    if (gettimeofday(&v, NULL)) {
-      Cli_Printf("Error Getting Time \n");
-      return CLI_ERROR;
-    }
-
-    mPtr = localtime((const time_t *)&(v.tv_sec));
-
-    mPtr->tm_sec = sec;
-    mPtr->tm_min = min;
-    mPtr->tm_hour = hour;
-    if ((v.tv_sec = mktime(mPtr)) < 0) {
-      Cli_Printf("ERROR: invalid time \n");
-      return CLI_ERROR;
-    }
-
-    Cli_Printf("Stopping Proxy software while changing clock settings.\n");
-
-    StopTrafficServer();
-
-    if (settimeofday(&v, NULL) == -1) {
-      Cli_Printf("ERROR: could not update time \n");
-
-      StartTrafficServer();
-
-      return CLI_ERROR;
-    }
-
-    if (system("/sbin/hwclock --systohc --utc") != 0) {
-      Cli_Error("ERROR: Unable to set hardware clock.\n");
-    }
-
-    StartTrafficServer();
-  }
-
-  Cli_Debug("Config:clock: get time\n");
-  if (system("date '+TIME: %H:%M:%S'") == -1)
-    Cli_Error("ERROR: Unable to set date.\n");
-
-  return CLI_OK;
-}
-
-// config timezone sub-command
-//   used to set the system timezone
-int
-ConfigTimezone(int index, int setvar)
-{
-
-  Cli_Debug("ConfigTime: %d %d\n", index, setvar);
-
-  FILE *fp, *tmp;
-  const char *zonetable = "/usr/share/zoneinfo/zone.tab";
-  char command[256];
-  char buffer[1024];
-  char old_zone[1024];
-  char new_zone[1024];
-  char *zone;
-
-  new_zone[0] = 0;
-
-  fp = fopen(zonetable, "r");
-  tmp = fopen("/tmp/zonetab.tmp", "w");
-  if (fp == NULL || tmp == NULL) {
-    printf("can not open the file\n");
-    return CLI_ERROR;
-  }
-  ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
-  while (!feof(fp)) {
-    if (buffer[0] != '#') {
-      strtok(buffer, " \t");
-      strtok(NULL, " \t");
-      zone = strtok(NULL, " \t");
-      if (zone[strlen(zone) - 1] == '\n') {
-        zone[strlen(zone) - 1] = '\0';
-      }
-      fprintf(tmp, "%s\n", zone);
-    }
-    ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
-  }
-  fclose(fp);
-  fclose(tmp);
-  remove("/tmp/zonetab");
-  ATS_UNUSED_RETURN(system("/bin/sort /tmp/zonetab.tmp > /tmp/zonetab"));
-
-  fp = fopen("/tmp/zonetab", "r");
-  ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
-  int i = 0;
-  while (!feof(fp)) {
-    zone = buffer;
-    if (zone[strlen(zone) - 1] == '\n') {
-      zone[strlen(zone) - 1] = '\0';
-    }
-    if (setvar) {
-      if (index == i) {
-        ink_strlcpy(new_zone, zone, sizeof(new_zone));
-      }
-    }
-    ATS_UNUSED_RETURN(fgets(buffer, 1024, fp));
-    i++;
-  }
-  fclose(fp);
-  remove("/tmp/zonetab.tmp");
-  remove("/tmp/zonetab");
-
-  switch (setvar) {
-  case 0:                      //get
-    find_value("/etc/sysconfig/clock", "ZONE", old_zone, sizeof(old_zone), "=", 0);
-    if (strlen(old_zone)) {
-      Cli_Printf("%s\n", old_zone);
-    } else {
-      Cli_Printf("NULL\n");
-    }
-    return CLI_OK;
-
-  case 1:                      //set
-    if (getuid() != 0) {
-      Cli_Printf("\nMust be \"root\" user to change the timezone.\n"
-                 "Use \"config:root\" command to switch to root user.\n");
-      return CLI_ERROR;
-    }
-
-    if (!strlen(new_zone)) {
-      Cli_Error("ERROR: Invalid timezone specified.\n");
-      return CLI_ERROR;
-    }
-
-    Cli_Printf("Stopping Proxy software while changing clock settings.\n");
-
-    StopTrafficServer();
-
-    Cli_Printf("New timezone is %s\n", new_zone);
-
-    fp = fopen("/etc/sysconfig/clock", "r");
-    tmp = fopen("/tmp/clock.tmp", "w");
-    ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
-    while (!feof(fp)) {
-      if (strstr(buffer, "ZONE") != NULL) {
-        fprintf(tmp, "ZONE=\"%s\"\n", new_zone);
-      } else if (strstr(buffer, "UTC") != NULL) {
-        fprintf(tmp, "UTC=true\n");
-      } else {
-        fputs(buffer, tmp);
-      }
-      ATS_UNUSED_RETURN(fgets(buffer, 256, fp));
-    }
-    fclose(fp);
-    fclose(tmp);
-    if (system("/bin/mv /tmp/clock.tmp /etc/sysconfig/clock") == -1)
-      return CLI_ERROR;
-
-    snprintf(command, sizeof(command), "/bin/cp -f /usr/share/zoneinfo/%s /etc/localtime", new_zone);
-    if (system(command) == -1)
-      return CLI_ERROR;
-
-    StartTrafficServer();
-
-    return CLI_OK;
-
-  }
-  Cli_Printf("Error in File Open to Read\n");
-  return CLI_ERROR;
-}
 
 int
 ConfigTimezoneList()

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ff35aa24/cmd/traffic_shell/ConfigCmd.h
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ConfigCmd.h b/cmd/traffic_shell/ConfigCmd.h
index 520d5f4..38d3d74 100644
--- a/cmd/traffic_shell/ConfigCmd.h
+++ b/cmd/traffic_shell/ConfigCmd.h
@@ -458,26 +458,6 @@ int Cmd_ConfigSocks(ClientData clientData, Tcl_Interp * interp, int argc, const
 int CmdArgs_ConfigSocks();
 
 ////////////////////////////////////////////////////////////////
-// Cmd_ConfigClock
-//
-// This is the callback function for the "config:clock" command.
-//
-// Parameters:
-//    clientData -- information about parsed arguments
-//    interp -- the Tcl interpreter
-//    argc -- number of command arguments
-//    argv -- the command arguments
-//
-int Cmd_ConfigClock(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-
-////////////////////////////////////////////////////////////////
-// CmdArgs_ConfigClock
-//
-// Register "config:clock" arguments with the Tcl interpreter.
-//
-int CmdArgs_ConfigClock();
-
-////////////////////////////////////////////////////////////////
 // Cmd_ConfigSecurity
 //
 // This is the callback function for the "config:security" command.
@@ -768,12 +748,6 @@ int ConfigName(const char *proxy_name);
 int ConfigPortsSet(int arg_ref, void *valuePtr);
 int ConfigPortsGet(int arg_ref);
 
-// config Date sub-command
-int ConfigDate(char *datestr);
-
-// config Time sub-command
-int ConfigTime(char *timestr);
-
 // config Timezone sub-command
 int ConfigTimezone(int, int);