Python app as a Display Manager

hg hg at nospam.org
Sun Jul 1 16:55:01 CEST 2007


"Martin v. Löwis" wrote:

>> I feel at this stage that what I miss is: assuming I manage to get a
>> python-based dialog box started automatically from init.rc (instead of
>> xdm, gdm, ...): how do I start an X11 session with the user/pw
>> information retrieved ... + set the correct *nix environment variables.
> 
> First, the user will enter username and password into your dialog box.
> You need to verify this, either by using the pwd module, or by using PAM
> (through python-pam).
> 
> Then you need start a session. Fork a subprocess, and use setuid/setgid
> to take the identity of the subprocess. In the parent process, wait for
> this child process to terminate, then display your dialog again (perhaps
> restarting the X server in-between).
> 
> What you do in your session is your own choice. It is custom to set a
> few environment variables, and then run /etc/X11/Xsession (or whereever
> the standard X11 session script lives); the latter is done through exec,
> i.e. when Xsession returns, the user has chosen to logout.
> 
> This is the basic working principle; different display managers deviate
> in how precisely they setup the session, and what precisely they run in
> what order.
> 
> However, this entire discussion is off-topic for comp.lang.python;
> please ask on comp.windows.x instead.
> 
> HTH,
> Martin

Martin,

Many many thanks, I did post here also so someone would tell me whether
using Python was feasible or not for this project (ex, having tkinter or
wxPython running prior t oan actual X11 session). Also I did not know about
comp.windows.x.

Regards,

hg





More information about the Python-list mailing list