[4483] in testers
Linux: $PRINTER (getcluster vs cshrc)
daemon@ATHENA.MIT.EDU (Jacob Morzinski)
Wed Jun 21 16:55:39 2000
Date: Wed, 21 Jun 2000 16:55:06 -0400
From: Jacob Morzinski <jmorzins@MIT.EDU>
To: testers@mit.edu
Message-ID: <Pine.SGI.4.21L.0006211633230.116901-100000@horobi.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Ever since the udpate to 8.4, sipb's machine alice-whacker has
been unable to print. Users logging into it get their PRINTER
variable set to the rather odd value of "meadow;".
This turns out to be a tussle between the behavior of
/bin/athena/getcluster (rpm athena-getcluster-8.4-0), which puts
a semicolon on the ends of the lines in /var/athena/clusterinfo,
and the $initdir/{cshrc,bashrc} files, which use awk to pull
information out of the clusterinfo files instead of source'ing
the whole file, or eval'ing lines of the file.
To me, it seems like the simplest solution would be to change the
cshrc and bashrc files to eval the appropriate line of the
clusterinfo files. (Another solution would be to cause
getcluster to stop putting semicolons in its csh-style output.)
--- /usr/athena/lib/init/cshrc Mon Jun 19 19:00:06 2000
+++ cshrc Wed Jun 21 16:52:57 2000
@@ -64,7 +64,7 @@
set bindir=arch/${ATHENA_SYS}/bin
if ( ! $?PRINTER && -e /var/athena/clusterinfo ) then
- setenv PRINTER `awk '/LPR/ { print $3 }' /var/athena/clusterinfo`
+ eval `sed -n 's/LPR/PRINTER/gp' /var/athena/clusterinfo`
if ( $PRINTER == "" ) unsetenv PRINTER
endif
--- /usr/athena/lib/init/bashrc Mon Jun 19 19:00:05 2000
+++ bashrc Wed Jun 21 16:49:44 2000
@@ -91,8 +91,8 @@
export ATHENA_SYS=@sys
fi
- if [ "${PRINTER+set}" != set -a -e /var/athena/clusterinfo ]; then
- PRINTER=`awk '/LPR/ { print $3 }' /var/athena/clusterinfo`
+ if [ "${PRINTER+set}" != set -a -e /var/athena/clusterinfo.bsh ]; then
+ eval `sed -n 's/LPR/PRINTER/gp' /var/athena/clusterinfo.bsh`
if [ -n "$PRINTER" ]; then export PRINTER; fi
fi