script "</dev/tcp/127.0.0.1/80" relies on /bin/sh being bash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
keepalived |
Fix Released
|
Unknown
|
|||
keepalived (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
The /usr/share/
vrrp_script chk_http_port {
script "</dev/
interval 1 # check every second
weight -2 # default prio: -2 if connect fails
}
however this works only on systems where `/bin/sh` is Bash, and therefore doesn't work on Ubuntu. This happens because `script` basically passes the script name to stdlib's system(), which in turn does (see system(3)):
execl(
When `/bin/sh` is Bash then `script "</dev/
As the sample file comes from upstream I filed an upstream issue [1].
Possible workarounds are (warning: untested!):
script "bash -c '</dev/
script "nc -z 127.0.0.1 80"
Changed in keepalived (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in keepalived: | |
status: | Unknown → New |
Changed in keepalived: | |
status: | New → Fix Released |
Note for context: this is a spin-off from LP: #1795420.