In a ssh session over IPv6, "ltrace pinky" shows:
...
strncpy(0x7fff7204e2c0, "2a01:e35:1380:19a0:3187:b730:838"..., 256) = 0x7fff7204e2c0
strchr("2a01:e35:1380:19a0:3187:b730:838"..., ':') = ":e35:1380:19a0:3187:b730:8380:97"...
getaddrinfo("2a01", NULL, 0x00607c20, 0x7fff7204e288) = -2
printf(" %s:%s", "2a01", "e35:1380:19a0:3187:b730:8380:97e"...) = 39
...
I looked into this and found that
pinky tries to canonicalize the information in the "Where" column
automaticaly, and it has no option to disable this behaviour.
see line 285 pinky.c:
if (*ut_host)
/* See if we can canonicalize it. */
host = canon_host (ut_host);
this results in many unnecessary dns queries.
For example on a debian system with acpi-support, /etc/acpi/lid.sh will
make many requests to find the host $WAYLAND_DISPLAY every time the lid
is opened.
"who" has the --lookup (attempt to canonicalize hostnames via DNS)
option, and doesn't do it by default.
Maybe it would be more lightweight to forget about canonicalization
altogether.
I don't see anything in lid.sh that calls pinky.
pinky is slow here on Fedora 39 too. I agree that it should avoid this by default. pinky is supposed to be a lightweight finger after all. I'll apply the attached to upstream coreutils soon. thanks, Pádraig
/etc/acpi/lid.sh calls getXuser, that's defined in
/usr/share/acpi-support/power-funcs
which has on line 36
plist=$(pinky -fw) || pwf_error "pinky lost"
I'd suggest a wishlist bug on acpi-support-base to use "who -us" in place of "pinky -fw". who is a posix standard command, pinky is an oddball that was hacked up from who years ago because someone liked the finger command output and wanted something that would add the full name, .plan, .project, etc., to the regular who output (none of which is used by acpi). Basically, pinky is simply not the right tool for the task at hand and it makes more sense IMO to use the right tool than to try to add functionality to a 30 year old special-purpose tool intended to replicate the functionality of an information program from another era.