ossobv / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
0 stars 0 forks source link

runtime: (minor) "the input device is not a TTY" redis-cli #38

Open wdoekes opened 6 days ago

wdoekes commented 6 days ago

Description

root@leaf1:~# redis-cli -n 4 --raw keys "BGP_NEIGHBOR|*" | head -n3
BGP_NEIGHBOR|default|10.0.0.47
BGP_NEIGHBOR|10.0.0.75
BGP_NEIGHBOR|10.0.0.61
root@leaf1:~# redis-cli -n 4 --raw keys "BGP_NEIGHBOR|*" | xargs redis-cli -n 4 del
the input device is not a TTY
root@leaf1:~# redis-cli -n 4 --raw keys "BGP_NEIGHBOR|*" | xargs redis-cli -n 4 del | cat
116

Caused by:

root@leaf1:~# docker exec -it database cat < /dev/null
the input device is not a TTY

cat $(which redis-cli)

#!/bin/bash

DOCKER_EXEC_FLAGS="i"

# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
    DOCKER_EXEC_FLAGS+="t"
fi

docker exec -$DOCKER_EXEC_FLAGS database redis-cli "$@"

Which build are we running (if any)

SONiC Software Version: SONiC.Edgecore-SONiC_20241018_041000_ec202211_ecsonic_431
SONiC OS Version: 11
Distribution: Debian 11.11
Kernel: 5.10.0-18-2-amd64
Build commit: 885c31394
Build date: Fri Oct 18 10:42:28 UTC 2024
Built by: ubuntu@ip-10-5-1-163

Platform: x86_64-accton_as7326_56x-r0
HwSKU: Accton-AS7326-56X
ASIC: broadcom
ASIC Count: 1

Upstream issues/PRs