Author Topic: "TERM environment variable not set" I got this massage on email.  (Read 17262 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
"TERM environment variable not set" I got this massage on email.
« on: February 16, 2018, 03:04:47 AM »
Hi everyone.
Sorry for my bad english.
I had this massage on Anacron jop mail from my server.

Code: [Select]
######################
Update Server Packages
######################
TERM environment variable not set.
https://mirrors.ustc.edu.cn/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.
Redirecting to /bin/systemctl restart cwpsrv.service
Redirecting to /bin/systemctl restart cwp-phpfpm.service
Redirecting to /bin/systemctl reload cwpsrv.service
Redirecting to /bin/systemctl reload cwp-phpfpm.service

Date which backup script is using: 2018-02-15 18:13:33

What does it mean?
Search resulut fot "TERM environment variable not set" is not helpful for me.
Please tell me how can I fix it.

Offline
**
Re: "TERM environment variable not set" I got this massage on email.
« Reply #1 on: February 16, 2018, 08:17:02 AM »
Hi,
I noticed today that I have problems too

Quote
######################
Update Server Packages
######################
TERM environment variable not set.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[16-Feb-2018 03:50:16] WARNING: Nothing matches the include pattern '/usr/local/cwp/php71/etc/php-fpm.d/users/*.conf' from /usr/local/cwp/php71/etc/php-fpm.d/users.conf at line 1.
[16-Feb-2018 03:50:16] NOTICE: configuration file /usr/local/cwp/php71/etc/php-fpm.conf test is successful

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[16-Feb-2018 03:50:16] WARNING: Nothing matches the include pattern '/usr/local/cwp/php71/etc/php-fpm.d/users/*.conf' from /usr/local/cwp/php71/etc/php-fpm.d/users.conf at line 1.
[16-Feb-2018 03:50:16] NOTICE: configuration file /usr/local/cwp/php71/etc/php-fpm.conf test is successful


Date which backup script is using: 2018-02-16 02:50:17



Offline
*
Re: "TERM environment variable not set" I got this massage on email.
« Reply #2 on: February 25, 2018, 03:52:31 AM »
@angelbro
it means that the variable TERM is not set for the whole environment, but it is available locally for root user.
To fix this we need to make the variable globally through 'export'.

1. connect to your server via SSH as root

2. Find out your TERM value
on the terminal execute
Code: [Select]
# echo $TERMmy result for e.g. is
Code: [Select]
xterm-256colorif yours is "dumb" then use "dump"
compare the output with
Code: [Select]
# printenv TERMit probably differs. either way proceed with the following.

3. export the variable
Now you just could do
Code: [Select]
# export TERM=xterm-256colorbut after a server reboot it would be forgotten.
so we need to put this into ~/.bashrc
Code: [Select]
# echo "export TERM=xterm-256color" >> ~/.bashrcor
Code: [Select]
# echo "export TERM=dumb" >> ~/.bashrcIMPORTANT: use ">>" it means append.
If you use ">" it will replace everything inside the file!

From now on - everytime you login in as root, the .bashrc script will say "make TERM=xterm-256color a public environment variable".
Alternative you could also put "export TERM=xterm-256color" OR "export TERM=dumb" into the cronjob (who sends you the emails) under: "/etc/cron.daily/cwp" to automate it if you like.
Probably good option if you don't login often as root very often.
 

4. finally: reload/execute .bashrc
Code: [Select]
# source ~/.bashrcit's the same as logout and login again.

I don't know why this happens. This should be easy peasy for the CWP creators.
ENJOY!  ;)

Source: https://linuxconfig.org/term-environment-variable-not-set-solution
Source: https://github.com/dockerfile/mariadb/issues/3
« Last Edit: February 25, 2018, 04:51:42 AM by zenben »

Offline
*
Re: "TERM environment variable not set" I got this massage on email.
« Reply #3 on: February 25, 2018, 04:28:01 AM »
@zakrpa
you have 2 more problems!

1. You need to fix "/usr/local/cwp/php71/etc/php-fpm.d/users.conf" at line 1.
don't know what is wrong there.
OR
Do you have a user account named "users" ?
If yes … delete him from CWP.

And second you need to to fix ERROR 1045
1. reset you mysql root passwort
to do that, execute:
Code: [Select]
# /scripts/mysql_pwd_reset
2. copy the new password
and make sure it is saved under ~/.my.cnf  AND  /usr/local/cwpsrv/var/services/pma/config.inc.php

Then you need to do this > https://www.ostraining.com/blog/coding/error-1045-phpmyadmin/
with your new password.

Maybe you have to fix ERROR 1045 before you can delete a user account (step 1).

Enjoy! ;)
« Last Edit: February 25, 2018, 04:35:38 AM by zenben »

Offline
*
Re: "TERM environment variable not set" I got this massage on email.
« Reply #4 on: February 28, 2018, 05:18:02 PM »
@angelbro & @zakrpa
Don't mention it, you are welcome!

Offline
*
Re: "TERM environment variable not set" I got this massage on email.
« Reply #5 on: January 19, 2021, 12:10:37 PM »
@zenben

Thanks, your solution with variable export worked!
For me (CentOS 7.9) it was
Code: [Select]
export TERM=xterm