ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
492 stars 578 forks source link

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

Open imcdona opened 7 years ago

imcdona commented 7 years ago

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.

kdanderso commented 4 years ago

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.

oalbrigt commented 4 years ago

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

kdanderso commented 4 years ago

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.

oalbrigt commented 4 years ago

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