From 9003d6e33941ebf38464356fee54c4882bdab06a Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 25 Mar 2013 09:01:59 +0100 Subject: [PATCH] pvebanner: overwrite /etc/issue instead of printing to stdout That way be get the pve banner for all spanned getty. We also create /etc/lsb-base-logging.sh and set FANCYTTY=0, because this work better wit bootlogd (no control characters in /var/log/boot. --- bin/init.d/pvebanner | 4 +++- bin/pvebanner | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bin/init.d/pvebanner b/bin/init.d/pvebanner index 83d3350d..9c3312c9 100755 --- a/bin/init.d/pvebanner +++ b/bin/init.d/pvebanner @@ -13,7 +13,9 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin -test -f $PVEDAEMON || exit 0 +test -f /usr/bin/pvebanner || exit 0 + +test -f /etc/lsb-base-logging.sh || echo "FANCYTTY=0" >/etc/lsb-base-logging.sh case "$1" in start) diff --git a/bin/pvebanner b/bin/pvebanner index 08971656..d8d1033d 100755 --- a/bin/pvebanner +++ b/bin/pvebanner @@ -7,11 +7,13 @@ use PVE::Cluster; my $nodename = PVE::INotify::nodename(); my $localip = PVE::Cluster::remote_node_ip($nodename, 1); -exit (0) if !$localip; -my $xline = '-' x 80; +my $xline = '-' x 78; -print <<__EOBANNER; +my $banner = ''; + +if ($localip) { + $banner .= <<__EOBANNER; $xline @@ -24,4 +26,14 @@ $xline __EOBANNER +} + +$banner .= "Debian GNU/Linux 7.0 \\n \\l\n\n"; + +open(ISSUE, ">/etc/issue"); + +print ISSUE $banner; + +close(ISSUE); + exit (0);