Subject: Re: free86-common: Should include /etc/X11/Xreset{.d}

From: Petter Reinholdtsen <[email-masked]>
Date: Sun, 31 Jan 2010 23:20:31 +0100

Any hope of having this fixed for Squeeze?  What can I do to help make
this feature available in Squeeze?

Happy hacking,
-- 
Petter Reinholdtsen

---

From: Brice Goglin <[email-masked]>
Date: Sun, 31 Jan 2010 23:39:56 +0100

> this feature available in Squeeze?

Find some maintainers for X in Debian :)

Brice

---

From: Petter Reinholdtsen <[email-masked]>
Date: Fri, 26 Feb 2010 10:00:32 +0100

tags 230422 + patch
thanks

[Brice Goglin]
> Find some maintainers for X in Debian :)

Do not know how to do that, but I do know how to make a patch
implementing the change I want.  This patch implement the Xreset.d
framework.  When it is in place, the next step is to get the display
manager maintainers to use it, ie get their own Xreset script to use
/etc/X11/Xreset.

With Debian Edu, we need a way to run stuff as root when a user log
out.  We did consider pam, but pam modules are running as the user
itself during logout, and do not allow all the operations we want to
do during logout.

Happy hacking,
-- 
Petter Reinholdtsen
diff -urN xorg-7.5+3/debian/local/Xreset xorg-7.5+3-pere/debian/local/Xreset
--- xorg-7.5+3/debian/local/Xreset	1970-01-01 01:00:00.000000000 +0100
+++ xorg-7.5+3-pere/debian/local/Xreset	2010-02-26 09:49:13.000000000 +0100
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# /etc/X11/Xreset
+#
+# global Xreset file -- for use by display managers
+
+# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $
+
+set -e
+
+PROGNAME=Xreset
+SYSSESSIONDIR=/etc/X11/Xreset.d
+
+if [ ! -d "$SYSSESSIONDIR" ]; then
+  # Nothing to do, exiting
+  exit 0
+fi
+
+# use run-parts to source every file in the session directory; we source
+# instead of executing so that the variables and functions defined above
+# are available to the scripts, and so that they can pass variables to each
+# other
+SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
+if [ -n "$SESSIONFILES" ]; then
+  set +e
+  for SESSIONFILE in $SESSIONFILES; do
+    . $SESSIONFILE
+  done
+  set -e
+fi
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=80:
diff -urN xorg-7.5+3/debian/local/Xreset.d/README xorg-7.5+3-pere/debian/local/Xreset.d/README
--- xorg-7.5+3/debian/local/Xreset.d/README	1970-01-01 01:00:00.000000000 +0100
+++ xorg-7.5+3-pere/debian/local/Xreset.d/README	2010-02-26 09:50:03.000000000 +0100
@@ -0,0 +1,2 @@
+Scripts in this directory are executed as root when a user log out from
+a display manager using /etc/X11/Xreset.
diff -urN xorg-7.5+3/debian/rules xorg-7.5+3-pere/debian/rules
--- xorg-7.5+3/debian/rules	2010-01-27 16:55:10.000000000 +0100
+++ xorg-7.5+3-pere/debian/rules	2010-02-26 09:53:38.000000000 +0100
@@ -83,6 +83,8 @@
 	dh_link
 	dh_compress
 	dh_fixperms
+	chown root:root debian/x11-common/etc/X11/Xreset
+	chmod 755 debian/x11-common/etc/X11/Xreset
 	chown root:root debian/x11-common/etc/X11/Xsession
 	chmod 755 debian/x11-common/etc/X11/Xsession
 	dh_installdeb
diff -urN xorg-7.5+3/debian/x11-common.dirs xorg-7.5+3-pere/debian/x11-common.dirs
--- xorg-7.5+3/debian/x11-common.dirs	2010-01-27 16:55:10.000000000 +0100
+++ xorg-7.5+3-pere/debian/x11-common.dirs	2010-02-26 09:50:42.000000000 +0100
@@ -1,4 +1,5 @@
 etc/X11/Xresources
+etc/X11/Xreset.d
 etc/X11/Xsession.d
 usr/include/X11
 usr/lib/X11
diff -urN xorg-7.5+3/debian/x11-common.install xorg-7.5+3-pere/debian/x11-common.install
--- xorg-7.5+3/debian/x11-common.install	2010-01-27 16:55:10.000000000 +0100
+++ xorg-7.5+3-pere/debian/x11-common.install	2010-02-26 09:51:05.000000000 +0100
@@ -1,4 +1,6 @@
 debian/local/rgb.txt etc/X11
+debian/local/Xreset etc/X11
+debian/local/Xreset.d/* etc/X11/Xreset.d
 debian/local/Xsession etc/X11
 debian/local/Xsession.d/* etc/X11/Xsession.d
 debian/local/Xsession.options etc/X11