[ 
https://issues.apache.org/jira/browse/TS-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355671#comment-15355671
 ] 

ASF GitHub Bot commented on TS-4504:
------------------------------------

Github user zwoop commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/748#discussion_r69008502
  
    --- Diff: plugins/healthchecks/healthchecks.c ---
    @@ -301,8 +301,22 @@ parse_configs(const char *fname)
       char buf[2 * 1024];
       HCFileInfo *head_finfo = NULL, *finfo = NULL, *prev_finfo = NULL;
     
    -  if (NULL == (fd = fopen(fname, "r")))
    +  if (!fname) {
         return NULL;
    +  }
    +
    +  if ('/' == *fname) {
    +    fd = fopen(fname, "r");
    +  } else {
    +    char filename[PATH_MAX + 1];
    +
    +    snprintf(filename, sizeof(filename), "%s/%s", fname, TSConfigDirGet());
    +    fd = fopen(filename, "r");
    --- End diff --
    
    So, these files are the actual content files, and they really should not be 
based in the ATS config area (or anything near ATS run-time). Best practices 
says that you likely want to use an absolute path in these config files, I can 
add that to the docs.
    
    Also, all this changes if/when we replace this junk with a file serving 
remap based plugin :).


> healthchecks plugin does not use the default config dir as a base-path
> ----------------------------------------------------------------------
>
>                 Key: TS-4504
>                 URL: https://issues.apache.org/jira/browse/TS-4504
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Plugins
>            Reporter: Leif Hedstrom
>            Assignee: Leif Hedstrom
>             Fix For: 7.0.0
>
>
> If you specify e.g.
> {code}
> healthchecks.so checks.config
> {code}
> it's unlikely to find this file.



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

Reply via email to