← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~mwhudson/curtin:bye-route-hello-ip into curtin:master

 

bye net-tools \o/

one comment inline.

Diff comments:

> diff --git a/tools/find-tgt b/tools/find-tgt
> index 435dde2..2a53010 100755
> --- a/tools/find-tgt
> +++ b/tools/find-tgt
> @@ -47,11 +52,11 @@ wait_for_tgtd() {
>      local out="" pidstgt="" name="tgtd"
>      while :; do
>          # did we succesfully attach to the correct port?
> -        out=$(netstat --program --all --numeric 2>/dev/null) ||
> -            fail "failed to netstat --program --all --numeric"
> +        out=$(ss --processes --all --numeric 2>/dev/null) ||
> +            fail "failed to ss --processes --all --numeric"
>          pidstgt=$(echo "$out" |
> -            awk '$4 == portal { print $7; exit(0); }' "portal=$portal")
> -        if [ "$pidstgt" = "$pid/$name" ]; then
> +            awk '$5 == portal { print $7; exit(0); }' "portal=$portal")

alternatively, we can lean on ss's builtin support for filters:

ss --no-header --all --numeric --processes "src = inet:$portal"

Also, if we're only interested in listening connections, I suggest replacing --all by --listening.

> +        if { echo $pidstgt | grep --quiet "pid=$pid,"; }; then
>              error "expected pid $pid is listening on $portal on try $try."
>              return 0
>          elif [ -n "$pidstgt" ]; then


-- 
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/427468
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:bye-route-hello-ip into curtin:master.



References