"Your TERM variable is not set" error after upgrabing bash to 2.05a-2.
After I have upgraded bash to 2.05a-2 some scripts stops working
from cron with error message "Your TERM variable is not set".
When I write a command "echo $TERM >/tmp/TERM.out" into the
scripts and start them from cron I see that TERM==dumb. The
scripts work fine from console (TERM==linux), and Win box over
PuTTY (TERM==xterm).
Not all the scripts behave like this. I suspect (though am not sure),
that only those which writes log files. For example:
#! /bin/sh
#
# /usr/local/bin/iptraflog_rot.sh
#
LOGNAME=ip_traffic-$(date +%y%m%d).log
set -e
/etc/ppp/ip-down.d/iptraf
mv /var/log/iptraf/ip_traffic-bg.log /var/log/iptraf/$LOGNAME
/etc/ppp/ip-up.d/iptraf
/bin/gzip /var/log/iptraf/$LOGNAME
exit 0
# EOF /usr/local/bin/iptraflog_rot.sh
#! /bin/sh
#
# /etc/ppp/ip-up.d/iptraf
#
test -x /usr/sbin/iptraf || exit 0
DAEMONARGS="/usr/sbin/iptraf -i ppp0 -B -L
/var/log/iptraf/ip_traffic-bg.log"
set -e
if [ -z "$(ps ax | grep "$DAEMONARGS" | grep -v grep)" ]; then
$DAEMONARGS
fi
exit 0
# EOF /etc/ppp/ip-up.d/iptraf
#! /bin/sh
#
# /etc/ppp/ip-down.d/iptraf
#
IPTRAFPID=$(ps ax | \
grep "/usr/sbin/iptraf -i ppp0 -B -L /var/log/iptraf/ip_traffic-bg.log" | \
grep -v grep | awk '{print($1)}')
set -e
if [ $(echo $IPTRAFPID | grep '^[1-9][0-9]*$') ]; then
kill -USR2 $IPTRAFPID
fi
exit 0
# EOF /etc/ppp/ip-down.d/iptraf
Before upgrading bash all the scripts work fine.
Software used:
Debian Linux unstable
kernel 2.4.14 custom
libc6 2.2.4-6
bash 2.05a-2
file /etc/terminfo/d/dumb exists
Can anybody tell me, please, what is the cause of the problem.
Thank you, Mikhail.
Reply to: