[ 
https://issues.apache.org/jira/browse/TS-4399?focusedWorklogId=30870&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30870
 ]

ASF GitHub Bot logged work on TS-4399:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Oct/16 04:16
            Start Date: 19/Oct/16 04:16
    Worklog Time Spent: 10m 
      Work Description: Github user jpeach commented on a diff in the pull 
request:

    https://github.com/apache/trafficserver/pull/1073#discussion_r83994912
  
    --- Diff: cmd/traffic_manager/traffic_manager.cc ---
    @@ -610,32 +616,37 @@ main(int argc, const char **argv)
       RecLocalStart(configFiles);
     
       /* Update cmd line overrides/environmental overrides/etc */
    -  if (tsArgs) { /* Passed command line args for proxy */
    -    ats_free(lmgmt->proxy_options);
    -    lmgmt->proxy_options = tsArgs;
    -    mgmt_log("[main] Traffic Server Args: '%s'\n", lmgmt->proxy_options);
    -  }
    +  if (tsArgs)  /* Passed command line args for proxy */
    +    callback_proxy_options.push_back(ats_strdup(tsArgs));
     
    -  // we must pass in bind_stdout and bind_stderr values to TS
    -  // we do it so TS is able to create BaseLogFiles for each value
    +  // we must give bind_stdout and bind_stderr values to 
callback_proxy_options
    +  // so LocalManager can start up TS with the correct options
    +  //
    +  // TS needs them to be able to create BaseLogFiles for each value
       if (*bind_stdout != 0) {
    -    size_t l = strlen(lmgmt->proxy_options);
    -    size_t n = 3                            /* " --" */
    -               + sizeof(TM_OPT_BIND_STDOUT) /* nul accounted for here */
    -               + 1                          /* space */
    -               + strlen(bind_stdout);
    -    lmgmt->proxy_options = static_cast<char 
*>(ats_realloc(lmgmt->proxy_options, n + l));
    -    snprintf(lmgmt->proxy_options + l, n, " --%s %s", TM_OPT_BIND_STDOUT, 
bind_stdout);
    +    char *bind_stdout_opt = new char[strlen("--") + 
strlen(TM_OPT_BIND_STDOUT)];
    +    strcpy(bind_stdout_opt, "--");
    +    strcat(bind_stdout_opt, TM_OPT_BIND_STDOUT);
    +    callback_proxy_options.push_back(bind_stdout_opt);
    +    callback_proxy_options.push_back(ats_strdup(bind_stdout));
       }
     
       if (*bind_stderr != 0) {
    -    size_t l = strlen(lmgmt->proxy_options);
    -    size_t n = 3                            /* space dash dash */
    -               + sizeof(TM_OPT_BIND_STDERR) /* nul accounted for here */
    -               + 1                          /* space */
    -               + strlen(bind_stderr);
    -    lmgmt->proxy_options = static_cast<char 
*>(ats_realloc(lmgmt->proxy_options, n + l));
    -    snprintf(lmgmt->proxy_options + l, n, " --%s %s", TM_OPT_BIND_STDERR, 
bind_stderr);
    +    char *bind_stderr_opt = new char[strlen("--") + 
strlen(TM_OPT_BIND_STDERR)];
    +    strcpy(bind_stderr_opt, "--");
    +    strcat(bind_stderr_opt, TM_OPT_BIND_STDERR);
    --- End diff --
    
    ```C
    foo.push_back("--" TM_OPT_BIND_STDERR")


Issue Time Tracking
-------------------

    Worklog Id:     (was: 30870)
    Time Spent: 40m  (was: 0.5h)

> Management API breaks diagnostic log rotation
> ---------------------------------------------
>
>                 Key: TS-4399
>                 URL: https://issues.apache.org/jira/browse/TS-4399
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Logging, Management API
>            Reporter: James Peach
>            Assignee: Daniel Xu
>             Fix For: 7.1.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Start up Traffic Server:
> {code}
>     0 26950     1   0 10:13AM ??         0:00.01 /opt/ats/bin/traffic_cop
>    -2 26951 26950   0 10:13AM ??         0:00.02 /opt/ats/bin/traffic_manager 
> --bind_stdout /opt/ats/var/log/trafficserver/traffic.out --bind_stderr 
> /opt/ats/var/log/trafficserver/traffic.out
>    -2 26952 26951   0 10:13AM ??         0:00.08 /opt/ats/bin/traffic_server 
> -M --bind_stdout /opt/ats/var/log/trafficserver/traffic.out --bind_stderr 
> /opt/ats/var/log/trafficserver/traffic.out --httpport 8080:fd=12
> {code}
> Now restart it using {{traffic_line -S}} followed by {{traffic_line -U}}:
> {code}
>     0 26950     1   0 10:13AM ??         0:00.01 /opt/ats/bin/traffic_cop
>    -2 26951 26950   0 10:13AM ??         0:00.05 /opt/ats/bin/traffic_manager 
> --bind_stdout /opt/ats/var/log/trafficserver/traffic.out --bind_stderr 
> /opt/ats/var/log/trafficserver/traffic.out
>    -2 26967 26951   0 10:13AM ??         0:00.12 /opt/ats/bin/traffic_server 
> -M --httpport 8080:fd=20
> {code}
> Note that we lost the {{\--bind_stdout}} and {{\--bind_stderr}} options.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to