Re: Python app as a Display Manager

2007-07-01 Thread hg
"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


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python app as a Display Manager

2007-07-01 Thread Martin v. Löwis
> 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
-- 
http://mail.python.org/mailman/listinfo/python-list


Python app as a Display Manager

2007-06-30 Thread hg
Hi,

I asked that question a while back ... and then gave up:

I want to write a simple display manager (*nix / X11) in Python.

I'm going through lots of documentation as well as the code of XDM.

1) I currently understand that the "X11 Intrinsics" are what I need to
master in order to get there.

2) Also, it seems that The Python app needs to adjust to X11 callbacks ...
although I will use TKinter or another Framework to actually do the
drawing.

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.


Can you direct me some info / give me a clue ?

Many thanks,

hg



-- 
http://mail.python.org/mailman/listinfo/python-list