[26794] in Athena Bugs

home help back first fref pref prev next nref lref last post

linux: X server: DontZap

daemon@ATHENA.MIT.EDU (Jacob Morzinski)
Fri Mar 31 19:55:40 2006

Message-Id: <200604010054.k310sHBJ005433@horobi.mit.edu>
From: Jacob Morzinski <morzinski@mit.edu>
To: bugs@mit.edu
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Date: Fri, 31 Mar 2006 19:54:17 -0500
X-Spam-Score: 1.217
X-Spam-Level: * (1.217)
X-Spam-Flag: NO
Errors-To: bugs-bounces@mit.edu

--=-=-=

Hi,

I'm not sure if my memory is playing tricks on me... but under
Athena 9.3 (or earlier), wasn't the XFree86 "DontZap" option
enabled for Linux machines?

DontZap is not enabled on my 9.4 linux machine, which I've
verified by accidentally killing my X server (sigh).  Perhaps the
option setting was lost, when we switched from the XFree86
config file, /etc/X11/XF86Config, to X.Org, /etc/X11/xorg.conf.

(It looks like the athena-ws postinstall scriptlet still tries to
enable DontZap, but it only looks for the old XFree86 config file.
See:  `rpm -q athena-ws --scripts | grep -A2 -i dontzap` )



I'd be very happy if Athena workstations had DontZap turned off.

I'm not very experienced with RPM spec files, but I attempted to
make a patch for the athena-ws-9.4.24.src.rpm's spec file:

   /afs/dev/system/rhlinux/athena-9.4/SRPMS/athena-ws-9.4-24.src.rpm 

Notes:
- The patch blithely uses "perl -i" for a few of its changes.
  (I figure that if it was good enough for the xorg-x11 rpm's
  scripts, it's good enough for here.)
- I threw a few test cases against it, but don't guarantee that
  I've caughe every test condition.
- The patch also updates a "XFree86" trigger to refer to
  "xterm-192", since XFree86 is no longer installed.



Thanks,
 -Jacob



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=athena-ws-9.4.patch
Content-Description: Patch to athena-ws spec file

--- athena-ws-9.4.orig	2006-03-31 18:30:06.000000000 -0500
+++ athena-ws-9.4	2006-03-31 19:37:45.000000000 -0500
@@ -81,7 +81,7 @@
 %triggerin -- sysklogd
 cp /etc/syslog.conf.athena /etc/syslog.conf
 
-%triggerin -- XFree86
+%triggerin -- xterm-192
 cp /usr/X11R6/lib/X11/app-defaults/XTerm.athena /usr/X11R6/lib/X11/app-defaults/XTerm
 
 %triggerin -- openmotif
@@ -394,19 +394,34 @@
   fi
 fi
 
+
+# Begin adjusting X configuration
+pushd /etc/X11
+for configfile in xorg.conf XF86Config XF86Config-4 ; do
+  if [ -f $configfile ]; then
+
 # Turn on DontZap in the X configuration.
-if [ -f /etc/X11/XF86Config ]; then
-  sed -e 's/#DontZap/DontZap/' < /etc/X11/XF86Config > /etc/X11/XF86Config.new
-  mv /etc/X11/XF86Config.new /etc/X11/XF86Config
-fi
+# If DontZap is commented out, un-comment it.
+# If DontZap is missing but its section is present, insert DontZap.
+# If the section is not present, insert the whole section.
+    if grep -q -i DontZap $configfile ; then
+      perl -p -i -e 's/#(.*DontZap)/\1/i' $configfile
+    elif grep -q -i '^[[:space:]]*Section[[:space:]]\+"ServerFlags"' $configfile ; then
+      perl -0777 -p -i -e 's/^([[:space:]]*Section[[:space:]]+"ServerFlags".*\n)/\1\tOption\t"DontZap"\t"true"\n/mi' $configfile
+    else
+      perl -0777 -p -i -e 's/(EndSection.*\n)/\1\nSection "ServerFlags"\n\tOption\t"DontZap"\t"true"\nEndSection\n/mi' $configfile
+    fi
+  fi
 
 # Enable loading of freetype and type1 font handlers in the X configuration.
-if [ -f /etc/X11/XF86Config-4 ]; then
   sed -e 's/#[[:space:]]*\(Load[[:space:]]\+"freetype"\)/\1/' \
       -e 's/#[[:space:]]*\(Load[[:space:]]\+"type1"\)/\1/' \
-      /etc/X11/XF86Config-4 > /etc/X11/XF86Config-4.new
-  mv /etc/X11/XF86Config-4.new /etc/X11/XF86Config-4
-fi
+      $configfile > $configfile.new
+  mv $configfile.new $configfile
+
+done    # for configfile in xorg.conf...
+popd
+# Done adjusting X configuration
 
 # kernel-headers-2.2.16-3 from Red Hat moved /usr/include/{linux,asm}
 # from the file list so the post script.  Since new versions of RPMs

--=-=-=--

home help back first fref pref prev next nref lref last post