resource-agents icon indicating copy to clipboard operation
resource-agents copied to clipboard

Kamailio resource agent: tput: No value for $TERM and no -T specified

Open imcdona opened this issue 8 years ago • 4 comments

When running the Kamailio resource agent I receive the following in /var/log/messages whenever the resource is checked:

notice: kamailio_monitor_10000:2784:stderr [ TERM environment variable not set. ] notice: kamailio_monitor_10000:2784:stderr [ tput: No value for $TERM and no -T specified ]

I'm running CentOS 7.3 with Corosync/Pacemaker installed via the CentOS repos.

My apologies in advance if this is a configuration issue on my part.

imcdona avatar May 31 '17 18:05 imcdona

The issue occurs because the monitor facility uses the "kamctl monitor" script. This script calls rpc_kamailio_monitor() in kamctl.rpcfifo. That function runs two commands that expect a terminal. The first is "clear" which gives the first notice and the second is "tput clear" which gives the second notice.

A resolution would be to check for $TERM and only execute the commands if $TERM is set. This may be more appropriately addressed by the Kamailio project.

kdanderso avatar Apr 23 '20 16:04 kdanderso

Maybe a fix would be to add [ -z "$TERM" ] && TERM="xterm"?

oalbrigt avatar Apr 24 '20 14:04 oalbrigt

I don't think that would be appropriate, because there is no terminal when the resource agent runs the monitor task.

[ -z "$TERM" ] || clear and [ -z "$TERM" ] || tput clear

might be a solution.

kdanderso avatar Apr 24 '20 14:04 kdanderso

Ah. Fixing it in kamctl would be even better :+1:

oalbrigt avatar Apr 24 '20 14:04 oalbrigt