Skip to content
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 7 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aznfswatchdog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

@linuxsmiths linuxsmiths Aug 25, 2023

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:

  1. Older versions of bash may not be handling it fine. I don't know about this, but this is a possibility.
  2. 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

if [ $? -eq 0 ] && [ "$conntrack_timeo_timew" -gt "$AZNFS_TIMEWAIT_TIMEOUT" ]; then
vecho "Changing /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait [$conntrack_timeo_timew -> $AZNFS_TIMEWAIT_TIMEOUT]"
echo $AZNFS_TIMEWAIT_TIMEOUT > /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait
fi
Expand Down