-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding double quotes #79
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linuxsmiths
reviewed
Aug 25, 2023
@@ -137,7 +137,7 @@ conntrack -L > /dev/null | |||
|
|||
# conntrack timewait timeout higher than the TCP timewait timeout value isn't very valuable. | |||
conntrack_timeo_timew=$(cat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait 2>/dev/null) | |||
if [ $? -eq 0 -a $conntrack_timeo_timew -gt $AZNFS_TIMEWAIT_TIMEOUT ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually a correct statement. There are two reasons it might be failing:
- Older versions of bash may not be handling it fine. I don't know about this, but this is a possibility.
- The second possibility is that one of $conntrack_timeo_timew and $AZNFS_TIMEWAIT_TIMEOUT are null. Since AZNFS_TIMEWAIT_TIMEOUT is defined explicitly, this means conntrack_timeo_timew could be the one undefined, which means the above statement is yielding an empty value. This means netfilter module is not loaded and/or not present. In this case even the current code that you updated will also fail.
let's discuss this
linuxsmiths
reviewed
Sep 7, 2023
linuxsmiths
reviewed
Sep 7, 2023
linuxsmiths
approved these changes
Sep 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug on line 140 in aznfswatchdog script: [: too many arguments
if [ $? -eq 0 -a $conntrack_timeo_timew -gt $AZNFS_TIMEWAIT_TIMEOUT ]; then
Solution:
Wrap the variable in double quotes, forcing it to stay as one string (therefore one argument).