Re: [gdm-list] Per-user session scripts for GDM defaults?




Jouko:

I use a very simple script to compress and decompress my Firefox profiles
to a small, 64 MB tmpfs ram disk, every time I log in or out.
This works wonderfully, especially on minilaptops with slow flash drives
(like my Acer A110L).

Essentially, the scriptlet runs any scripts in $HOME/.session/
as the user, with a parameter describing the phase (postlogin, presession,
or postsession). This seems to work quite reliably and without problems.

However, I'm up shit creek with a lousy paddle every time I update GDM.

More often than not, I need to compare the distribution-updated Defaults
to my own, and decide if there was any sensible changes.
If I just accept the new Defaults, I lose my profiles.
If I decline, there may be a misconfiguration that'll bite my ass later.
(Lately, I've mostly used Xubuntu on my workstations.)

You are right that GDM lacks a nice interface to specify that system
specific scripts should be run from the GDM PostLogin, PreSession, and
PostSession scripts.

It would be reasonable to file an RFE in the "gdm" category at
http://bugzilla.gnome.org/ with this request.  It seems reasonable to
add a hook to these scripts so that sysadmins can specify additional
code to run without needing to modify the scripts shipped as a part of
GDM.

As I think about this, one possible workaround which might work well
for some users...

Note that GDM supports running per-display PreSession and PostSession
scripts.  So, if you have an executable script named:

/etc/gdm/PreSession/:0

Then this script will always be run *instead* of the Default script for
$DISPLAY ":0".  If you always log into $DISPLAY ":0", then you could
create a script which executes the Default script and then runs any
extra code that you want to run.  This should work well and avoid
issues with the default scripts changing on upgrade.

Because of this fragility, I cannot even recommend this to others.
Other administrators balk at the extra work and TLC GDM needs for
this to work -- quite correctly so.

And it irks me: I've found storing the Firefox profiles on a tmpfs
makes for a much snappier browser, without any of the drawbacks of
having a purely ephemeral profile. And I'd be surprised if this was the
only trick people do with their session scripts.

Would you be willing to add something like the above scriptlets
to PostLogin, PreSession.in and PostSession.in,
to provide this per-user session script functionality?

It probably does not make sense to integrate Firefox specific code
into the default GDM scripts.  However, adding a hook so that
the GDM PostLogin, PreSession, and PostLogin scripts can run a
separate script defined by the sysadmin would make sense.  Perhaps, for
example, /etc/gdm/PreSession/Default could check for the existence of a
script named /etc/gdm/PreSession/Default.system and run it if it is
present.  Then the sysadmin could set up this script to run whatever
code they want without worry about it getting overwritten on update.

As I say above, filing an RFE in bugzilla.gnome.org would be the
best way to track this and get it moving forward.  Also, providing
a proposed patch for discussion would likely speed the process.

Brian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]