Skip to content

Commit

Permalink
samples: At note for not using </dev/tcp/... syntax not using bash
Browse files Browse the repository at this point in the history
Issue #1926 identified that
   script "</dev/tcp/127.0.0.1/80"
is bash specific, and a vrrp_script using that will fail if /bin/sh
is not Bash.

This commit adds a note to the keepalived.conf.vrrp.localcheck sample
script when using shells other than Bash.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed Jul 4, 2021
1 parent 1bb1b62 commit 8f65800
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/samples/keepalived.conf.vrrp.localcheck
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
! Configuration File for keepalived

# Note: The "</dev/tcp/127.0.0.1/80" syntax for a script
# requires that /bin/sh is Bash.
# On systems where /bin/sh is not Bash (e.g. Debian, Ubuntu),
# then the following alternatives should be used:
# script "bash -c '</dev/tcp/127.0.0.1/80'"
# or
# script "nc -z 127.0.0.1 80"

vrrp_script chk_sshd {
script "killall -0 sshd" # cheaper than pidof
interval 2 # check every 2 seconds
Expand Down

0 comments on commit 8f65800

Please sign in to comment.