Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-19 Thread Fred Liu
As an alternative, we may think about using system-logind to kill all user's 
processes when logout...

Thanks.

Fred

-Original Message-
From: x2go-dev  On Behalf Of Oleksandr Shneyder
Sent: 2021年8月13日 22:25
To: Ulrich Sibiller 
Cc: x2go-dev@lists.x2go.org
Subject: Re: [X2Go-Dev] Clean processes after x2goterminate-session

In my tests dbus and all processes running inside of the session having PGID of 
x2goruncommand.

Alex

Am 13.08.21 um 01:47 schrieb Ulrich Sibiller:
> Are you sure dbus does not have its own PGID?
> 
> Uli
> 
> On Thu, Aug 12, 2021 at 7:36 PM Oleksandr Shneyder 
>  wrote:
>>
>> Why we are not just saving the x2goruncommand PID in the session 
>> directory. All spawned processes will have a  PGID identical to the 
>> PID of x2goruncommand. In the x2goterminate-session we can terminate 
>> all processes with PGID identical to x2goruncommand PID:
>>
>> kill -- -X2GORUNCMD_PID
>>
>> looks simple to me and POSIX confirm. Any objections?
>>
>>
>> regards,
>> Alex
>>
>>
>> Am 11.08.21 um 04:57 schrieb Mike Gabriel:
>>> On  Di 10 Aug 2021 18:10:41 CEST, Ulrich Sibiller wrote:
>>>
>>>> Probably it would be best to use dbus for session termination if it 
>>>> is running.
>>>
>>> This could be one puzzle piece, indeed. Basically, we can kill 
>>> x2goruncommand and then the session manager would automatically go 
>>> into logout.
>>>
>>> However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray 
>>> processes around (e.g. gvfsd, colord, etc.). For these friends, some 
>>> more intelligence is required. Might have that in the X2Go Server 
>>> renicer code already, because Lee at those early times worked on 
>>> code that detects the complete process tree of a running desktop session.
>>>
>>> Nowadays, one could argue that cgroups are another and better 
>>> alternative. But cgroups are not available on non-Linux, so maybe a 
>>> kernel-agnostic approach is a more favourable way to go?
>>>
>>> Mike
>>
>>
>> --
>> ---
>> Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
>> phoca GmbH| Tel. : 0911 - 14870374 0
>> Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
>> D-90491 Nürnberg  | Mobil: 0163 - 49 64 461
>>
>> Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder
>>
>> Amtsgericht München   | http://www.phoca-gmbh.de
>> HRB 196 658   | http://www.x2go.org
>> USt-IdNr.: DE281977973
>> ---
>>


--
---
Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
phoca GmbH| Tel. : 0911 - 14870374 0
Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
D-90491 Nürnberg  | Mobil: 0163 - 49 64 461

Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder

Amtsgericht München   | http://www.phoca-gmbh.de
HRB 196 658   | http://www.x2go.org
USt-IdNr.: DE281977973
---



--

This email has been scanned for spam and viruses. Visit the following link to 
report this email as spam:
https://securemail.cloud-protect.net/index01.php?mod_id=11_option=logitem_id=1628864719-MZsKPgao79T4_address=fliu%40issi.com=1


___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-13 Thread Oleksandr Shneyder
In my tests dbus and all processes running inside of the session having
PGID of x2goruncommand.

Alex

Am 13.08.21 um 01:47 schrieb Ulrich Sibiller:
> Are you sure dbus does not have its own PGID?
> 
> Uli
> 
> On Thu, Aug 12, 2021 at 7:36 PM Oleksandr Shneyder
>  wrote:
>>
>> Why we are not just saving the x2goruncommand PID in the session
>> directory. All spawned processes will have a  PGID identical to the PID
>> of x2goruncommand. In the x2goterminate-session we can terminate all
>> processes with PGID identical to x2goruncommand PID:
>>
>> kill -- -X2GORUNCMD_PID
>>
>> looks simple to me and POSIX confirm. Any objections?
>>
>>
>> regards,
>> Alex
>>
>>
>> Am 11.08.21 um 04:57 schrieb Mike Gabriel:
>>> On  Di 10 Aug 2021 18:10:41 CEST, Ulrich Sibiller wrote:
>>>
 Probably it would be best to use dbus for session termination if it is
 running.
>>>
>>> This could be one puzzle piece, indeed. Basically, we can kill
>>> x2goruncommand and then the session manager would automatically go into
>>> logout.
>>>
>>> However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray
>>> processes around (e.g. gvfsd, colord, etc.). For these friends, some
>>> more intelligence is required. Might have that in the X2Go Server
>>> renicer code already, because Lee at those early times worked on code
>>> that detects the complete process tree of a running desktop session.
>>>
>>> Nowadays, one could argue that cgroups are another and better
>>> alternative. But cgroups are not available on non-Linux, so maybe a
>>> kernel-agnostic approach is a more favourable way to go?
>>>
>>> Mike
>>
>>
>> --
>> ---
>> Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
>> phoca GmbH| Tel. : 0911 - 14870374 0
>> Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
>> D-90491 Nürnberg  | Mobil: 0163 - 49 64 461
>>
>> Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder
>>
>> Amtsgericht München   | http://www.phoca-gmbh.de
>> HRB 196 658   | http://www.x2go.org
>> USt-IdNr.: DE281977973
>> ---
>>


-- 
---
Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
phoca GmbH| Tel. : 0911 - 14870374 0
Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
D-90491 Nürnberg  | Mobil: 0163 - 49 64 461

Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder

Amtsgericht München   | http://www.phoca-gmbh.de
HRB 196 658   | http://www.x2go.org
USt-IdNr.: DE281977973
---



OpenPGP_signature
Description: OpenPGP digital signature
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-13 Thread Ulrich Sibiller
Are you sure dbus does not have its own PGID?

Uli

On Thu, Aug 12, 2021 at 7:36 PM Oleksandr Shneyder
 wrote:
>
> Why we are not just saving the x2goruncommand PID in the session
> directory. All spawned processes will have a  PGID identical to the PID
> of x2goruncommand. In the x2goterminate-session we can terminate all
> processes with PGID identical to x2goruncommand PID:
>
> kill -- -X2GORUNCMD_PID
>
> looks simple to me and POSIX confirm. Any objections?
>
>
> regards,
> Alex
>
>
> Am 11.08.21 um 04:57 schrieb Mike Gabriel:
> > On  Di 10 Aug 2021 18:10:41 CEST, Ulrich Sibiller wrote:
> >
> >> Probably it would be best to use dbus for session termination if it is
> >> running.
> >
> > This could be one puzzle piece, indeed. Basically, we can kill
> > x2goruncommand and then the session manager would automatically go into
> > logout.
> >
> > However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray
> > processes around (e.g. gvfsd, colord, etc.). For these friends, some
> > more intelligence is required. Might have that in the X2Go Server
> > renicer code already, because Lee at those early times worked on code
> > that detects the complete process tree of a running desktop session.
> >
> > Nowadays, one could argue that cgroups are another and better
> > alternative. But cgroups are not available on non-Linux, so maybe a
> > kernel-agnostic approach is a more favourable way to go?
> >
> > Mike
>
>
> --
> ---
> Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
> phoca GmbH| Tel. : 0911 - 14870374 0
> Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
> D-90491 Nürnberg  | Mobil: 0163 - 49 64 461
>
> Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder
>
> Amtsgericht München   | http://www.phoca-gmbh.de
> HRB 196 658   | http://www.x2go.org
> USt-IdNr.: DE281977973
> ---
>
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-12 Thread Oleksandr Shneyder
Why we are not just saving the x2goruncommand PID in the session
directory. All spawned processes will have a  PGID identical to the PID
of x2goruncommand. In the x2goterminate-session we can terminate all
processes with PGID identical to x2goruncommand PID:

kill -- -X2GORUNCMD_PID

looks simple to me and POSIX confirm. Any objections?


regards,
Alex


Am 11.08.21 um 04:57 schrieb Mike Gabriel:
> On  Di 10 Aug 2021 18:10:41 CEST, Ulrich Sibiller wrote:
> 
>> Probably it would be best to use dbus for session termination if it is
>> running.
> 
> This could be one puzzle piece, indeed. Basically, we can kill
> x2goruncommand and then the session manager would automatically go into
> logout.
> 
> However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray
> processes around (e.g. gvfsd, colord, etc.). For these friends, some
> more intelligence is required. Might have that in the X2Go Server
> renicer code already, because Lee at those early times worked on code
> that detects the complete process tree of a running desktop session.
> 
> Nowadays, one could argue that cgroups are another and better
> alternative. But cgroups are not available on non-Linux, so maybe a
> kernel-agnostic approach is a more favourable way to go?
> 
> Mike


-- 
---
Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
phoca GmbH| Tel. : 0911 - 14870374 0
Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
D-90491 Nürnberg  | Mobil: 0163 - 49 64 461

Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder

Amtsgericht München   | http://www.phoca-gmbh.de
HRB 196 658   | http://www.x2go.org
USt-IdNr.: DE281977973
---



OpenPGP_signature
Description: OpenPGP digital signature
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-12 Thread Ulrich Sibiller
Hmm, linger is a feature _per user_ not _per sessions_. So this can
only be done if the user does have/intent to have other sessions as
well.

Uli

On Thu, Aug 12, 2021 at 4:00 AM Norman Gaywood  wrote:
>
> There is also the issue that and x2go login sets "linger" mode:
>
> loginctl enable-linger
>
> If this is needed (linger needs to be enabled), it would be good if x2go did 
> a:
>
> loginctl disable-linger
>
> on log out.
>
> On Wed, 11 Aug 2021 at 21:02, Ulrich Sibiller  wrote:
>>
>> On Wed, Aug 11, 2021 at 11:57 AM Mike Gabriel
>>  wrote:
>> > > Probably it would be best to use dbus for session termination if it
>> > > is running.
>> >
>> > This could be one puzzle piece, indeed. Basically, we can kill
>> > x2goruncommand and then the session manager would automatically go
>> > into logout.
>> >
>> > However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray
>> > processes around (e.g. gvfsd, colord, etc.). For these friends, some
>> > more intelligence is required. Might have that in the X2Go Server
>> > renicer code already, because Lee at those early times worked on code
>> > that detects the complete process tree of a running desktop session.
>> >
>> > Nowadays, one could argue that cgroups are another and better
>> > alternative. But cgroups are not available on non-Linux, so maybe a
>> > kernel-agnostic approach is a more favourable way to go?
>>
>> Yes, I absolutely vote for cgroups. Other systems probably have
>> similar approaches but for Linux cgroups is the way to go, IMO.
>>
>> Uli
>> ___
>> x2go-dev mailing list
>> x2go-dev@lists.x2go.org
>> https://lists.x2go.org/listinfo/x2go-dev
>
>
>
> --
> Norman Gaywood, Computer Systems Officer
> School of Science and Technology
> University of New England
> Armidale NSW 2351, Australia
>
> ngayw...@une.edu.au  http://turing.une.edu.au/~ngaywood
> Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062
>
> Please avoid sending me Word or Power Point attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-11 Thread Norman Gaywood
There is also the issue that and x2go login sets "linger" mode:

loginctl enable-linger

If this is needed (linger needs to be enabled), it would be good if x2go
did a:

loginctl disable-linger

on log out.

On Wed, 11 Aug 2021 at 21:02, Ulrich Sibiller  wrote:

> On Wed, Aug 11, 2021 at 11:57 AM Mike Gabriel
>  wrote:
> > > Probably it would be best to use dbus for session termination if it
> > > is running.
> >
> > This could be one puzzle piece, indeed. Basically, we can kill
> > x2goruncommand and then the session manager would automatically go
> > into logout.
> >
> > However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray
> > processes around (e.g. gvfsd, colord, etc.). For these friends, some
> > more intelligence is required. Might have that in the X2Go Server
> > renicer code already, because Lee at those early times worked on code
> > that detects the complete process tree of a running desktop session.
> >
> > Nowadays, one could argue that cgroups are another and better
> > alternative. But cgroups are not available on non-Linux, so maybe a
> > kernel-agnostic approach is a more favourable way to go?
>
> Yes, I absolutely vote for cgroups. Other systems probably have
> similar approaches but for Linux cgroups is the way to go, IMO.
>
> Uli
> ___
> x2go-dev mailing list
> x2go-dev@lists.x2go.org
> https://lists.x2go.org/listinfo/x2go-dev
>


-- 
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngayw...@une.edu.au  http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-11 Thread Mike Gabriel

On  Di 10 Aug 2021 18:10:41 CEST, Ulrich Sibiller wrote:

Probably it would be best to use dbus for session termination if it  
is running.


This could be one puzzle piece, indeed. Basically, we can kill  
x2goruncommand and then the session manager would automatically go  
into logout.


However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray  
processes around (e.g. gvfsd, colord, etc.). For these friends, some  
more intelligence is required. Might have that in the X2Go Server  
renicer code already, because Lee at those early times worked on code  
that detects the complete process tree of a running desktop session.


Nowadays, one could argue that cgroups are another and better  
alternative. But cgroups are not available on non-Linux, so maybe a  
kernel-agnostic approach is a more favourable way to go?


Mike
--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de



pgpZjG7q1gXxT.pgp
Description: Digitale PGP-Signatur
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-11 Thread Ulrich Sibiller
On Wed, Aug 11, 2021 at 11:57 AM Mike Gabriel
 wrote:
> > Probably it would be best to use dbus for session termination if it
> > is running.
>
> This could be one puzzle piece, indeed. Basically, we can kill
> x2goruncommand and then the session manager would automatically go
> into logout.
>
> However, esp. the GTK desktops (MATE, XFCE, etc.) leave many stray
> processes around (e.g. gvfsd, colord, etc.). For these friends, some
> more intelligence is required. Might have that in the X2Go Server
> renicer code already, because Lee at those early times worked on code
> that detects the complete process tree of a running desktop session.
>
> Nowadays, one could argue that cgroups are another and better
> alternative. But cgroups are not available on non-Linux, so maybe a
> kernel-agnostic approach is a more favourable way to go?

Yes, I absolutely vote for cgroups. Other systems probably have
similar approaches but for Linux cgroups is the way to go, IMO.

Uli
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Clean processes after x2goterminate-session

2021-08-10 Thread Ulrich Sibiller
Probably it would be best to use dbus for session termination if it is running.

Uli

On Tue, Aug 10, 2021 at 5:15 PM Oleksandr Shneyder
 wrote:
>
> Hello all,
>
> I realized, that sometimes (depends on distro and DE) after terminating
> session with x2goterminate-session some processes related to the X2Go
> session are not exiting. At the moment x2goterminate-session only
> terminates the agent process and we can have leftovers like
> x2goruncommand, dbus-run-session, etc.
> I think we should do some improvements in x2goterminate-session to clean
> this processes.
> Any ideas?
>
> regards,
> Alex
> --
> ---
> Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
> phoca GmbH| Tel. : 0911 - 14870374 0
> Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
> D-90491 Nürnberg  | Mobil: 0163 - 49 64 461
>
> Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder
>
> Amtsgericht München   | http://www.phoca-gmbh.de
> HRB 196 658   | http://www.x2go.org
> USt-IdNr.: DE281977973
> ---
>
> ___
> x2go-dev mailing list
> x2go-dev@lists.x2go.org
> https://lists.x2go.org/listinfo/x2go-dev
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


[X2Go-Dev] Clean processes after x2goterminate-session

2021-08-10 Thread Oleksandr Shneyder
Hello all,

I realized, that sometimes (depends on distro and DE) after terminating
session with x2goterminate-session some processes related to the X2Go
session are not exiting. At the moment x2goterminate-session only
terminates the agent process and we can have leftovers like
x2goruncommand, dbus-run-session, etc.
I think we should do some improvements in x2goterminate-session to clean
this processes.
Any ideas?

regards,
Alex
-- 
---
Oleksandr Shneyder| Email: o.shney...@phoca-gmbh.de
phoca GmbH| Tel. : 0911 - 14870374 0
Schleiermacherstr. 2  | Fax. : 0911 - 14870374 9
D-90491 Nürnberg  | Mobil: 0163 - 49 64 461

Geschäftsführung: Dipl.-Inf. Oleksandr Shneyder

Amtsgericht München   | http://www.phoca-gmbh.de
HRB 196 658   | http://www.x2go.org
USt-IdNr.: DE281977973
---



OpenPGP_signature
Description: OpenPGP digital signature
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev