Python app as a Display Manager

H

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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

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
 
H

hg

Martin v. Löwis said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,297
Messages
2,571,527
Members
48,249
Latest member
reactnativeexpert

Latest Threads

Top