[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510316#comment-15510316 ] Bjorn Stange commented on ZOOKEEPER-2578: - I can't seem to find any official documentation on actually setting ZOOCFG or any of the variables used by the init scripts for zookeeper. Perhaps that should be modified instead? I can imagine a section titled "Using a non-default configuration filename" or something along those lines. > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange >Priority: Minor > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510278#comment-15510278 ] ASF GitHub Bot commented on ZOOKEEPER-2578: --- Github user Bjorn248 closed the pull request at: https://github.com/apache/zookeeper/pull/80 > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange >Priority: Minor > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510244#comment-15510244 ] Patrick Hunt commented on ZOOKEEPER-2578: - Yes, adding comments would be great. You should modify the original patch though, as it is not b/w compat (hopefully you can figure out a way around it that works for everyone, e.g. third variable if possible?) > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange >Priority: Minor > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510232#comment-15510232 ] Bjorn Stange commented on ZOOKEEPER-2578: - Thanks [~phunt], should I add some comments to the original code and submit a new patch? Now that I think of it, I don't think using a third variable would work because ZOOCFG is the variable that is directly referenced by other scripts both before and after this script is run. > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange >Priority: Minor > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510185#comment-15510185 ] Patrick Hunt commented on ZOOKEEPER-2578: - I agree it's not as clear as it could be - took me a bit to figure out what the script was trying to do in order to respond to this JIRA. I would say if you are interested to address then what you are saying would make sense - a third variable of some kind. Mainly we don't want to change the existing functionality, i.e. the changes should be b/w compat from a user perspective. I'd also recommend updating (adding) the comments in the file to be more clear (for the next person that comes along and has similar questions). Thanks Bjorn! > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15501786#comment-15501786 ] Bjorn Stange commented on ZOOKEEPER-2578: - The issue is that ZOOCFG changes to become the absolute path to the config file and that is what the scripts expect it to be but it starts out (if left empty) as just the filename. I find that confusing because it has drastically different starting and ending states. Is it supposed to be the absolute path? Is it supposed to be the filename? Otherwise, I do see your point. I was trying to override the final state of ZOOCFG in zookeeper-env.sh and not the intermediate state, and doing what you suggest would indeed work. Perhaps using a third variable for the absolute path to the config file would reduce ambiguity here as well? I was just confused by the way this variable was being handled and thought I'd open a discussion around it. > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15501736#comment-15501736 ] Patrick Hunt commented on ZOOKEEPER-2578: - Hi [~bjorn...@gmail.com] - perhaps I'm missing something but I believe the intent was for the user to provide (if they want to override either/both) ZOOCFGDIR and ZOOCFG. Where ZOOCFGDIR is the location of the cfg file, and ZOOCFG is the name of the config file at ZOOCFGDIR. As such the current logic seems right to me. What limitation/issue do you see with this? Other than the obvious - you might need to specify both ZOOCFGDIR and ZOOCFG rather than just specifying ZOOCFG as an absolute path, including the cfg file name. > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15488395#comment-15488395 ] ASF GitHub Bot commented on ZOOKEEPER-2578: --- GitHub user Bjorn248 opened a pull request: https://github.com/apache/zookeeper/pull/80 ZOOKEEPER-2578: Fixed zkEnv.sh to not overwrite ZOOCFG with itself You can merge this pull request into a Git repository by running: $ git pull https://github.com/Bjorn248/zookeeper ZOOKEEPER-2578 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zookeeper/pull/80.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #80 commit eb4c2b42278a75944011c19bf50b60b9d3efacf3 Author: Bjorn Stange Date: 2016-09-13T20:34:57Z ZOOKEEPER-2578: Fixed zkEnv.sh to not overwrite ZOOCFG with itself > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15488355#comment-15488355 ] Bjorn Stange commented on ZOOKEEPER-2578: - I will await code review and further comments before submitting this as a patch. > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ZOOKEEPER-2578) zkEnv.sh does not set $ZOOCFG properly if already set
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15488351#comment-15488351 ] Bjorn Stange commented on ZOOKEEPER-2578: - I was using Zookeeper 3.4.6 to test this and encountered it by using a zookeeper-env.sh that set the value of ZOOCFG to /opt/zookeeper/zookeeper-3.4.6/conf/zoo.cfg. The final value of ZOOCFG after zkEnv.sh was evaluated was /opt/zookeeper/zookeeper-3.4.6/conf//opt/zookeeper/zookeeper-3.4.6/conf/zoo.cfg. This led me to report this bug and propose the patch. > zkEnv.sh does not set $ZOOCFG properly if already set > -- > > Key: ZOOKEEPER-2578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2578 > Project: ZooKeeper > Issue Type: Bug >Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2, 3.3.3, > 3.3.4, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.3.5, 3.3.6, 3.4.4, 3.4.5, 3.4.6, 3.4.7, > 3.4.8, 3.4.9, 3.4.10, 3.5.0, 3.5.1, 3.5.2 >Reporter: Bjorn Stange > Attachments: ZOOKEEPER-2578.patch > > > In bin/zkEnv.sh The ZOOCFG variable is duplicated over itself if already set. > For example, in my use case it was being set in zookeeper-env.sh. The problem > seems to arise from this line (line 61 on the master branch at the time of > this submission): ZOOCFG="$ZOOCFGDIR/$ZOOCFG". This overwrites the value of > ZOOCFG by appending the old value to the value of ZOOCFGDIR, which is > problematic if it was already initialized as the absolute path to a file. The > behavior of overwriting the value of the variable in this way seems to be > specific to the case where ZOOCFG is not initialized. The final state of > ZOOCFG seemingly is the absolute path to the zookeeper configuration file. > This behavior assumes that it is the filename only, which is where the bug > arises. -- This message was sent by Atlassian JIRA (v6.3.4#6332)