[Xrdp-devel] Adding Session Removal Functionality

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
Hey guys. So i posted this on the sourceforge forums as well, but though
that maybe the mailing list might elicit a faster response.
But here is my question:

So I am currently trying to add a feature to xrdp. The feature I would
be adding would be to totally remove a user's session when they
disconnect from the session. I know currently xrdp retains the session
in sesman so that a user can reconnect later on. I am facing the problem
of users who only use the session once, disconnect, but then their
sessions remain. This allows for unneeded processes hogging system
resources. I would just like to know, from those who are familiar with
the source, where I should start looking to add this functionality. I
was thinking it would be with sesman in the session management, but if
there is somewhere else where I can develop this faster/more
efficiently, I would be happy to know that. Thanks


-Murtaza Munaim


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Jonathan Buzzard

On Thu, 2010-06-17 at 12:17 -0700, Murtaza Munaim wrote:

> Hey guys. So i posted this on the sourceforge forums as well, but though
> that maybe the mailing list might elicit a faster response.
> But here is my question:
>
> So I am currently trying to add a feature to xrdp. The feature I would
> be adding would be to totally remove a user's session when they
> disconnect from the session. I know currently xrdp retains the session
> in sesman so that a user can reconnect later on. I am facing the problem
> of users who only use the session once, disconnect, but then their
> sessions remain. This allows for unneeded processes hogging system
> resources. I would just like to know, from those who are familiar with
> the source, where I should start looking to add this functionality. I
> was thinking it would be with sesman in the session management, but if
> there is somewhere else where I can develop this faster/more
> efficiently, I would be happy to know that. Thanks
>

The sesman.ini man page suggest that there are a number of related
options that one can set to control this, but all are apparently
ignored. The parameters are

KillDisconnected
IdleTimeLimit
DisconnectedTimeLimit

I guess implementing these is what is needed.

I am just feeling my way around the source myself at the moment, looking
to implement XRandR support in the x11rdp server and some associated
support in sesman.


JAB.

--
Jonathan A. Buzzard                 Email: jonathan (at) buzzard.me.uk
Fife, United Kingdom.



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

jsorg71
>> Hey guys. So i posted this on the sourceforge forums as well, but though
>> that maybe the mailing list might elicit a faster response.
>> But here is my question:
>>
>> So I am currently trying to add a feature to xrdp. The feature I would
>> be adding would be to totally remove a user's session when they
>> disconnect from the session. I know currently xrdp retains the session
>> in sesman so that a user can reconnect later on. I am facing the problem
>> of users who only use the session once, disconnect, but then their
>> sessions remain. This allows for unneeded processes hogging system
>> resources. I would just like to know, from those who are familiar with
>> the source, where I should start looking to add this functionality. I
>> was thinking it would be with sesman in the session management, but if
>> there is somewhere else where I can develop this faster/more
>> efficiently, I would be happy to know that. Thanks
>>
>
> The sesman.ini man page suggest that there are a number of related
> options that one can set to control this, but all are apparently
> ignored. The parameters are
>
> KillDisconnected
> IdleTimeLimit
> DisconnectedTimeLimit

>
> I guess implementing these is what is needed.

The plan is to implement these items in sesman.
It's a little difficult now because xrdp drops its connection with
sesman after the user is authenticated.  To implement this cleanly,
the connection should stay up to communicate when the client
disconnected.  It should stay up for other things as well.

> I am just feeling my way around the source myself at the moment, looking
> to implement XRandR support in the x11rdp server and some associated
> support in sesman.

XRandR is for resizing the Xserver desktop, is that right?
This can be done, RDP allows a resize sent from the server.
See server_reset in xrdp_types.h
You would have to get the event in X11rdp and send a message to xrdp
through the X11rdp - xrdp connection.

Jay

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
On 6/19/2010 9:34 AM, Jay Sorg wrote:

>>> Hey guys. So i posted this on the sourceforge forums as well, but though
>>> that maybe the mailing list might elicit a faster response.
>>> But here is my question:
>>>
>>> So I am currently trying to add a feature to xrdp. The feature I would
>>> be adding would be to totally remove a user's session when they
>>> disconnect from the session. I know currently xrdp retains the session
>>> in sesman so that a user can reconnect later on. I am facing the problem
>>> of users who only use the session once, disconnect, but then their
>>> sessions remain. This allows for unneeded processes hogging system
>>> resources. I would just like to know, from those who are familiar with
>>> the source, where I should start looking to add this functionality. I
>>> was thinking it would be with sesman in the session management, but if
>>> there is somewhere else where I can develop this faster/more
>>> efficiently, I would be happy to know that. Thanks
>>>
>>
>> The sesman.ini man page suggest that there are a number of related
>> options that one can set to control this, but all are apparently
>> ignored. The parameters are
>>
>> KillDisconnected
>> IdleTimeLimit
>> DisconnectedTimeLimit
>
>>
>> I guess implementing these is what is needed.
>
> The plan is to implement these items in sesman.
> It's a little difficult now because xrdp drops its connection with
> sesman after the user is authenticated.  To implement this cleanly,
> the connection should stay up to communicate when the client
> disconnected.  It should stay up for other things as well.
Jay, could you maybe explain how the current process works? Currently
this is what I imagine the process to work(from what I have read from
your documentation)

A xrdp client connects to the xrdp server, and preliminary
authentication details and encryption semantics are exchanged. Then, the
xrdp server connects to sesman, who authenticates the user, and selects
an existing session or creates a new Xvnc session. Then the connection
from xrdp to sesman is dropped.

So to implement these capabilities, xrdp would have to stay connected to
sesman the whole time the user is connected. So when xrdp sees that a
user disconnects, it should relay that information to sesman, who then
kills the Xvnc session?

Sorry if I repeating what you might have said and/or on your website. I
just want to make sure I have the entire protocol down, and and the
suggestion on how to fix it.

>
>> I am just feeling my way around the source myself at the moment, looking
>> to implement XRandR support in the x11rdp server and some associated
>> support in sesman.
>
> XRandR is for resizing the Xserver desktop, is that right?
> This can be done, RDP allows a resize sent from the server.
> See server_reset in xrdp_types.h
> You would have to get the event in X11rdp and send a message to xrdp
> through the X11rdp - xrdp connection.
>
> Jay
-Murtaza Munaim



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

jsorg71
> Jay, could you maybe explain how the current process works? Currently this
> is what I imagine the process to work(from what I have read from your
> documentation)
>
> A xrdp client connects to the xrdp server, and preliminary authentication
> details and encryption semantics are exchanged. Then, the xrdp server
> connects to sesman, who authenticates the user, and selects an existing
> session or creates a new Xvnc session. Then the connection from xrdp to
> sesman is dropped.

exactly.

> So to implement these capabilities, xrdp would have to stay connected to
> sesman the whole time the user is connected. So when xrdp sees that a user
> disconnects, it should relay that information to sesman, who then kills the
> Xvnc session?

Yes, but sesman should only kill the session if setup to do
so(KillDisconnected).

I can even explain which .c files need to be edited.

There is a new version of the xrdp - sesman protocol that Simon and I
started but never quite got finished.  I think this was one of the new
features.

Jay

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
On 6/19/2010 11:44 AM, Jay Sorg wrote:

>> Jay, could you maybe explain how the current process works? Currently this
>> is what I imagine the process to work(from what I have read from your
>> documentation)
>>
>> A xrdp client connects to the xrdp server, and preliminary authentication
>> details and encryption semantics are exchanged. Then, the xrdp server
>> connects to sesman, who authenticates the user, and selects an existing
>> session or creates a new Xvnc session. Then the connection from xrdp to
>> sesman is dropped.
>
> exactly.
>
>> So to implement these capabilities, xrdp would have to stay connected to
>> sesman the whole time the user is connected. So when xrdp sees that a user
>> disconnects, it should relay that information to sesman, who then kills the
>> Xvnc session?
>
> Yes, but sesman should only kill the session if setup to do
> so(KillDisconnected).
Yeah of course. Only if selected. But I have most of the protocol down?
Okay cool.
>
> I can even explain which .c files need to be edited.

That would be very helpful.
>
> There is a new version of the xrdp - sesman protocol that Simon and I
> started but never quite got finished.  I think this was one of the new
> features.
If you could send me a tarball of your newest "bleeding-edge" code, that
would be awesome.

>
> Jay

-Murtaza



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Vincent Bernat
In reply to this post by Murtaza Munaim
OoO  Pendant le journal  télévisé du  samedi 19  juin 2010,  vers 20:28,
Murtaza Munaim <[hidden email]> disait :

> A xrdp client connects to the xrdp server, and preliminary
> authentication details and encryption semantics are exchanged. Then,
> the xrdp server connects to sesman, who authenticates the user, and
> selects an existing session or creates a new Xvnc session. Then the
> connection from xrdp to sesman is dropped.

If you  are using a VNC  server, you can  try to launch it  with "-once"
parameter. It  should be  stopped when the  connection is  dropped.
--
printk(KERN_ERR "msp3400: chip reset failed, penguin on i2c bus?\n");
        2.2.16 /usr/src/linux/drivers/char/msp3400.c

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
On 6/19/2010 2:28 PM, Vincent Bernat wrote:

> OoO  Pendant le journal  télévisé du  samedi 19  juin 2010,  vers 20:28,
> Murtaza Munaim<[hidden email]>  disait :
>
>> A xrdp client connects to the xrdp server, and preliminary
>> authentication details and encryption semantics are exchanged. Then,
>> the xrdp server connects to sesman, who authenticates the user, and
>> selects an existing session or creates a new Xvnc session. Then the
>> connection from xrdp to sesman is dropped.
>
> If you  are using a VNC  server, you can  try to launch it  with "-once"
> parameter. It  should be  stopped when the  connection is  dropped.
Use a VNC server for? The main RDP server connection? No, we are using
xrdp for the server. If I misunderstood your question, please rectify it.

-Murtaza


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Vincent Bernat
OoO En cette nuit nuageuse du dimanche 20 juin 2010, vers 00:36, Murtaza
Munaim <[hidden email]> disait :

>>> A xrdp client connects to the xrdp server, and preliminary
>>> authentication details and encryption semantics are exchanged. Then,
>>> the xrdp server connects to sesman, who authenticates the user, and
>>> selects an existing session or creates a new Xvnc session. Then the
>>> connection from xrdp to sesman is dropped.
>>
>> If you  are using a VNC  server, you can  try to launch it  with "-once"
>> parameter. It  should be  stopped when the  connection is  dropped.

> Use a VNC server for? The main RDP server connection? No, we are using
> xrdp for the server. If I misunderstood your question, please rectify
> it.

You speak of  "new Xvnc session". I  assume that you are using  VNC as a
backend (and not x11rdp).  Therefore,  a VNC server is spawned by sesman
when  connecting to xrdp.  If you  passe "-once"  parameter to  this VNC
server, it will be killed when the client will disconnect.
--
BOFH excuse #418:
Sysadmins busy fighting SPAM.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
On 6/19/2010 3:42 PM, Vincent Bernat wrote:

> OoO En cette nuit nuageuse du dimanche 20 juin 2010, vers 00:36, Murtaza
> Munaim<[hidden email]>  disait :
>
>>>> A xrdp client connects to the xrdp server, and preliminary
>>>> authentication details and encryption semantics are exchanged. Then,
>>>> the xrdp server connects to sesman, who authenticates the user, and
>>>> selects an existing session or creates a new Xvnc session. Then the
>>>> connection from xrdp to sesman is dropped.
>>>
>>> If you  are using a VNC  server, you can  try to launch it  with "-once"
>>> parameter. It  should be  stopped when the  connection is  dropped.
>
>> Use a VNC server for? The main RDP server connection? No, we are using
>> xrdp for the server. If I misunderstood your question, please rectify
>> it.
>
> You speak of  "new Xvnc session". I  assume that you are using  VNC as a
> backend (and not x11rdp).  Therefore,  a VNC server is spawned by sesman
> when  connecting to xrdp.  If you  passe "-once"  parameter to  this VNC
> server, it will be killed when the client will disconnect.
Interesting. Ill try this and see how it works.

Thanks
-Murtaza


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
In reply to this post by Vincent Bernat
On 6/19/2010 3:42 PM, Vincent Bernat wrote:

> OoO En cette nuit nuageuse du dimanche 20 juin 2010, vers 00:36, Murtaza
> Munaim<[hidden email]>  disait :
>
>>>> A xrdp client connects to the xrdp server, and preliminary
>>>> authentication details and encryption semantics are exchanged. Then,
>>>> the xrdp server connects to sesman, who authenticates the user, and
>>>> selects an existing session or creates a new Xvnc session. Then the
>>>> connection from xrdp to sesman is dropped.
>>>
>>> If you  are using a VNC  server, you can  try to launch it  with "-once"
>>> parameter. It  should be  stopped when the  connection is  dropped.
>
>> Use a VNC server for? The main RDP server connection? No, we are using
>> xrdp for the server. If I misunderstood your question, please rectify
>> it.
>
> You speak of  "new Xvnc session". I  assume that you are using  VNC as a
> backend (and not x11rdp).  Therefore,  a VNC server is spawned by sesman
> when  connecting to xrdp.  If you  passe "-once"  parameter to  this VNC
> server, it will be killed when the client will disconnect.
  Jay, Let me know when you can get back to me with the details.

They will be much appreciated. Thank You

-Murtaza


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Jonathan Buzzard
In reply to this post by jsorg71
Jay Sorg wrote:

[SNIP]

>
>> I am just feeling my way around the source myself at the moment, looking
>> to implement XRandR support in the x11rdp server and some associated
>> support in sesman.
>
> XRandR is for resizing the Xserver desktop, is that right?

Correct, X Resize and Rotate, though it is the resize bit that interests me.

> This can be done,  RDP allows a resize sent from the server.

Indeed this is a commonly used feature on Windows Terminal Server. What
I am looking to do is when reconnecting to a session, be able to
reconnect with a different screen size, connect and then have x11rdp
resize it's screen to the new screen size. If that makes sense.

> See server_reset in xrdp_types.h
> You would have to get the event in X11rdp and send a message to xrdp
> through the X11rdp - xrdp connection.
>

Hum, I was thinking of it working the other way around, that is the
client through a session reconnection initiating the resize. However now
you bring it up both should be implemented.

One question I have is, is there any particular reason why x11rdp is not
included in xorg?


JAB.

--
Jonathan A. Buzzard                 Email: jonathan (at) buzzard.me.uk
Fife, United Kingdom.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Murtaza Munaim
In reply to this post by Murtaza Munaim
Hey. So I am trying to use the idea you gave me. I just can't find where
XVNC is spawned by xrdp in the source. Any clues?

-Murtaza


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

Vincent Bernat
OoO La nuit ayant déjà recouvert  d'encre ce jour du mardi 22 juin 2010,
vers 23:00, Murtaza Munaim <[hidden email]> disait :

> Hey. So I am trying to use the idea you gave me. I just can't find
> where XVNC is spawned by xrdp in the source. Any clues?

Look at sesman.ini, section Xvnc. You can add a parameter here.
--
BOFH excuse #137:
User was distributing pornography on server; system seized by FBI.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Xrdp-devel] Adding Session Removal Functionality

jsorg71
In reply to this post by Jonathan Buzzard
> Hum, I was thinking of it working the other way around, that is the client
> through a session reconnection initiating the resize. However now you bring
> it up both should be implemented.

Oh, I see, that would work.  I thought that you wanted to drag the
client corner to resize.
RDP does not support resizing like that.

> One question I have is, is there any particular reason why x11rdp is not
> included in xorg?

I didn't think it's in a good enough state yet.
Also, you can't use it alone with an RDP client, it has to work with xrdp.

Jay

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
xrdp-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel
Loading...