Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 14872 - Proposal to enhance {g,x,k}dm session startup
Summary: Proposal to enhance {g,x,k}dm session startup
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-31 15:02 UTC by Paul de Vrieze (RETIRED)
Modified: 2004-04-12 05:13 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
An ebuild that allows for pre and post session scripts. (sessionscripts.zip,1.24 KB, application/x-zip)
2003-04-09 08:08 UTC, Paul de Vrieze (RETIRED)
Details
changes to the gdm ebuild and a small source patch to allow pre/post session scripts (gdm.zip,1.24 KB, application/x-zip)
2003-04-09 08:24 UTC, Paul de Vrieze (RETIRED)
Details
A patch to the xfree Xsession script to allow for pre/post session scripts (xfree-Xsession.diff,1.12 KB, patch)
2003-04-09 08:28 UTC, Paul de Vrieze (RETIRED)
Details | Diff
newpg.zip - A new version of newpg that uses a presession script to start gpg-agent (newpg.zip,2.18 KB, application/x-zip)
2003-04-09 08:31 UTC, Paul de Vrieze (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul de Vrieze (RETIRED) gentoo-dev 2003-01-31 15:02:53 UTC
User-Agent:       
Build Identifier: 

Gdm and kdm allow users to select the session to be started. This bypasses the
~/.xsession file. This file is the file that traditionally gets used
for starting a window manager and personal favourite apps. gdm and kdm use the
directory /etc/X11/Sessions/ where each script represents a different session.
The scripts from this directory don't source .xsession as that would start a
second window manager. This means there should be another file to allow users to
start programs like ~/.xsession and ~/.bash_profile . A solution would be to
make a DMSession script is sourced from the various session scripts. This
DMSession script then conditionally sources a /etc/X11/dmprofile and a
${HOME}/.dmprofile script (based on existence). Those scripts would be the place
from which gpg-agent or XInput programs could be started, as well as user
specific scripts



Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-01 00:46:11 UTC
Should be WM specific if you ask me.  Like /etc/X11/Sessions/Gnome uses
.gnomerc
Comment 2 Paul de Vrieze (RETIRED) gentoo-dev 2003-02-01 07:00:46 UTC
While this is basically wm dependant, it is a bug involving ALL window managers.
This bug intends to get a decision on a general architecture, after which bugs on
different windowmanagers can be posted.

The rationale for such a script is both aegypten. For that to work gpg-agent needs
to be started and an environment variable needs to be set. Basically the same is
valid for XInput input methods such as kanna, xcin etc. They need all be started as the user and before any application is started. This is the place for that.
Comment 3 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-09 08:08:40 UTC
Created attachment 10430 [details]
An ebuild that allows for pre and post session scripts.

I made scripts that are helpfull in doing pre and post X session scripts. The
scripts execute all (executable) scripts in the /etc/X11/{pre,post}session.d
dirs, unless the user as a persional .{pre,post}session script. They need
support from the display manager, see the other attachments following
Comment 4 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-09 08:24:40 UTC
Created attachment 10431 [details]
changes to the gdm ebuild and a small source patch to allow pre/post session scripts

Small changes to gdm so that we can have presession scripts that give
their environment to the actual X session. The session scripts and the
session are now executed through a small wrapper. They cannot be started
through gdm's presession and postsession parts as those are executed as
root. That is obviously not safe.
Comment 5 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-09 08:28:17 UTC
Created attachment 10432 [details, diff]
A patch to the xfree Xsession script to allow for pre/post session scripts

This is a patch to the Xsession scripts for both 4.2.1-r2 and 4.3.0 (they are
the same). This patch changes the Xsession script in by sourcing the presession
script. Changing the execution of the actual session to a non-exec invocation
(so that we get a chance to do postsession things) and sourcing the postsession
script.
Comment 6 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-09 08:31:58 UTC
Created attachment 10433 [details]
newpg.zip - A new version of newpg that uses a presession script to start gpg-agent

This is an "example" use of the session scripts of the previous attachments.
This finally makes installing aegypten support for kmail easy.
Comment 7 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-09 08:47:15 UTC
I though I might as well make an implementation of what I mean. I just submitted
3 attachments that implement pre and post session scripts in gdm/kdm and xdm. The other attachment is a new version of newpg (contains gpg-agent which is necessary for the new style gpg support in kmail) that uses the scripts.

For gdm I made a small change to the source. This is to prevent needing to change
all the session scripts of all window managers. The rationale for the pre/post
sesion work is that there are programs that one might want to use for all users of
a host, with all window managers. But that need to run before the window manager.
The solution to edit all session scripts is not a real solution as these scripts change with a new version of the window manager (at least in case of kde), and
it makes the functioning dependant on correctness of the windowmanagers (of
which there are many).

I believe the most use is in the presession script (like with the .bashrc), but the postsession script can very well be used as a cleanup script (like .bash_logout). If there are things that are not clear about these patches,
please ask.
Comment 8 Dan Armak (RETIRED) gentoo-dev 2003-04-10 15:40:38 UTC
I'm going to look at it too, I was planning to do something about it but was unaware of this 
bugreport... Not today though :-) 
Comment 9 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-10 16:33:45 UTC
Well try it out / take a look at it. I would like to hear your comments.
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-13 15:39:29 UTC
Could we make it '/etc/X11/PreSession.d' and /etc/X11/PostSession.d, as it will
fit better with /etc/X11/Sessions ?
Comment 11 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-13 15:42:00 UTC
Also, for gdm it should be possible to just change /etc/X11/gdm/PreSession/Default
and /etc/X11/gdm/PostSession/Default ....
Comment 12 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-13 15:48:55 UTC
about comment #10, I see no problems with that. It's just that I don't like typing capitals ;-)

about comment #11. That is not possible as the gdm pre/post session scripts are run as root. You don't want that. Also for the presession to be able to pass through environment variables it must not be started from the presession script.
Actually I first tried to put the things in the gdm pre/post session scripts, but I then found out it didn't work for the presession, and was unsafe for the postsession. (I almost submitted the patches with unsafe postsession)
Comment 13 David ac 2003-05-18 21:55:02 UTC
I've recently needed this exact functionality on my system - what is the progress on this bug? as far as i can see, the functionality hasnt yet found its way into any of the default ebuilds - any indication on when this will happen?

thanks in advance

David ac
Comment 14 Paul de Vrieze (RETIRED) gentoo-dev 2003-05-19 03:59:04 UTC
Martin (azarah) has confirmed that he will look into it, but I guess that he is currently busy with other things. Please feel free to try the patches. I've put them together in http://www.cs.kun.nl/~pauldv/ebuilds/presession.zip. I currently don't have access to that server (firewall restrictions) so I cannot update it. It's xfree ebuild is dated. Basically what you need to do is copy the files from the portage archive, and replace only the XSession file with the one from my archive. Tonight I'll update the archive to contain an updated xfree ebuild.

If you have any questions about these ebuilds, feel free to ask them
Comment 15 Paul de Vrieze (RETIRED) gentoo-dev 2004-04-12 05:13:08 UTC
Ok, with gnome-2.6 and kde-3.2 this problem has solved itself. Both include their own Xsession script that uses /etc/xprofile and ~/.xprofile for x specific hooks. This is similar to what the presession scripts do, the post-session scripts are not that necessary so I'll close this for now. I'll make a nice package for session support new style, and have newpg depend on it. That should make things go well.