fix for defect 4337, add TERM into the systemd through systemctl import-environment TERM

This commit is contained in:
ligc 2013-10-31 13:23:19 +08:00
parent 0b35d9edd7
commit f101f97df4

View File

@ -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