Comment 26 for bug 722201

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Following error:

019/05/31 18:21:38.648661 ctdbd[1000]: Starting traverse on DB ctdb.tdb (id 806)
2019/05/31 18:21:38.651601 ctdbd[1000]: Ending traverse on DB ctdb.tdb (id 806), records 0
2019/05/31 18:21:40.185388 ctdb-eventd[1002]: 60.nfs: ss: bison bellows (while parsing filter): "syntax error!" Sorry.
2019/05/31 18:21:40.185421 ctdb-eventd[1002]: 60.nfs: Usage: ss [ OPTIONS ]
2019/05/31 18:21:40.185433 ctdb-eventd[1002]: 60.nfs: ss [ OPTIONS ] [ FILTER ]
2019/05/31 18:21:40.185441 ctdb-eventd[1002]: 60.nfs: -h, --help this message
2019/05/31 18:21:40.185449 ctdb-eventd[1002]: 60.nfs: -V, --version output version information

PROBLEM:

########################################################
# tickle handling
########################################################

update_tickles ()
{
 ...

    # the parentheses can't be empty! -> BROKEN:

    ss -tn state established \
       "${_ip_filter:+( ${_ip_filter} )}" \
       "${_port_filter:+( ${_port_filter} )}" |
    awk 'NR > 1 {print $4, $3}' |
    sort >"$_my_connections"

HERE:

60.nfs: + _port=2049
60.nfs: + tickledir=/var/lib/ctdb/scripts/tickles
60.nfs: + mkdir -p /var/lib/ctdb/scripts/tickles
60.nfs: + ctdb_get_pnn
60.nfs: + _pnn_file=/var/lib/ctdb/scripts/my-pnn
60.nfs: + [ ! -f /var/lib/ctdb/scripts/my-pnn ]
60.nfs: + cat /var/lib/ctdb/scripts/my-pnn
60.nfs: + _pnn=0
60.nfs: + /usr/bin/ctdb -X ip
60.nfs: + awk -F| -v pnn=0 $3 == pnn {print $2}it
60.nfs: + _ips=172.16.17.3
60.nfs: + _ip_filter= ok
60.nfs: + _ip_filter=src [172.16.17.3]
60.nfs: + _port_filter=sport == :2049
60.nfs: + _my_connections=/var/lib/ctdb/scripts/tickles/2049.connections.12623
60.nfs: + ss -tn state established ( src [172.16.17.3] ) ( sport == :2049
)
2019/05/31 18:44:35.631800 ctdb-eventd[12050]: 60.nfs: + awk NR > 1 {print $4, $3}

          ss -tn state established "src 172.16.17.3 sport == :2049"

Looks like using "( ... )" syntax for ss was no good.

Changing update_tickles () function to have:

    ss -tn state established "${_ip_filter} ${_port_filter}" | awk 'NR > 1 {print $4, $3}' | sort >"$_my_connections"

instead, fixes the issue.