aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorPetr Lautrbach <plautrba@redhat.com>2010-12-01 10:54:13 +0100
committerBill Nottingham <notting@redhat.com>2010-12-01 15:20:33 -0500
commit6e7a2f88a1c6d1fffe3be81f5b86a06f18a03299 (patch)
tree63f8fa332f1fd3bde61e946a8696e809e5a15dfd /rc.d/init.d/functions
parent6890d8788cda23492f14839a890aebf457bf3725 (diff)
downloadinitscripts-6e7a2f88a1c6d1fffe3be81f5b86a06f18a03299.tar
initscripts-6e7a2f88a1c6d1fffe3be81f5b86a06f18a03299.tar.gz
initscripts-6e7a2f88a1c6d1fffe3be81f5b86a06f18a03299.tar.bz2
initscripts-6e7a2f88a1c6d1fffe3be81f5b86a06f18a03299.tar.xz
initscripts-6e7a2f88a1c6d1fffe3be81f5b86a06f18a03299.zip
CONSOLETYPE - check read access to /dev/stderr (#650103)
Diffstat (limited to 'rc.d/init.d/functions')
-rw-r--r--rc.d/init.d/functions8
1 files changed, 7 insertions, 1 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 48ed4d79..1256d10e 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -48,7 +48,13 @@ systemctl_redirect () {
# Get a sane screen width
[ -z "${COLUMNS:-}" ] && COLUMNS=80
-[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)"
+if [ -z "${CONSOLETYPE:-}" ]; then
+ if [ -r "/dev/stderr" ]; then
+ CONSOLETYPE="$(/sbin/consoletype < /dev/stderr)"
+ else
+ CONSOLETYPE="$(/sbin/consoletype)"
+ fi
+fi
if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n ] ; then
. /etc/profile.d/lang.sh 2>/dev/null