From f101f97df40ed3565920206bd7c04e8f28912c78 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 31 Oct 2013 13:23:19 +0800 Subject: [PATCH] fix for defect 4337, add TERM into the systemd through systemctl import-environment TERM --- xCAT-server/sbin/xcatconfig | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 088388a3b..b504063cd 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -404,9 +404,18 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL) verbose("syslog has been set up."); } } - - -# +# The systemd only has LANG and PATH as default environmental variables, +# TERM is needed for KVM consoles(actually screen command needs TERM) +# import the TERM into systemd +if ( -d "/usr/lib/systemd/system" ) { + my $cmd = "systemctl import-environment TERM"; + xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message('E', "Could not import TERM into systemd."); + } else { + verbose("Imported TERM=$ENV{'TERM'} into systemd."); + } +} # # start xcatd