FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Desktop

 
 
LinkBack Thread Tools
 
Old 01-04-2008, 03:29 PM
David Zeuthen
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 17:19 +0100, Nils Philippsen wrote:
> Show me why your proposal (which you admitted can be circumvented
> easily) is better or more secure than fixing the handful of programs
> that don't end themselves when the session exits. If we don't talk about
> hostile processes which actively circumvent, we're talking about dumb
> processes. These should be fixed rather than declaring stuff which up to
> now worked correctly as erroneous just to avoid doing the fixing. Where
> is the difficulty in letting these handful of processes either connect
> to dbus, X11 or the session manager and bail out if the connection dies?
> I'm curious.

Maybe it's just me, but I think it's a lot easier to just fix the few
programs such as screen and nohup to opt out of getting reaped.. rather
than going through every potential program in the distro (or on the
planet) that people may launch in their session. There's an analogy
here: Maintaining a whitelist is a lot easier than maintaining a
blacklist.

> David, you need to accept that there are people who use computers
> differently than you think they should. This doesn't make them second
> class users. Only because an approach is different from what exists
> already, that doesn't make it better. I like to think that much can be
> achieved without hurting existing users. If that makes me a naysayer, it
> makes you a yeasayer which is almost equally bad ;-).

Nils, it's very evident you are in the annoying "oh, but it's worked
this way forever so we can't change it" camp. You need to accept that
some of us are not and your camp is sometimes perceived as hindering
progress. The indisputable fact is that X11 session service management
is just *broken* as I outlined in my original mail. The fact that some
people take advantage of this brokenness via screen, nohup etc. doesn't
mean we shouldn't fix the fundamental problem. Doesn't mean either we
shouldn't fix the few oddball cases such as screen and nohup to opt out
of getting reaped.

David


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:35 PM
Colin Walters
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 17:23 +0100, Nils Philippsen wrote:
> On Fri, 2008-01-04 at 11:10 -0500, Colin Walters wrote:
> > On Fri, 2008-01-04 at 16:14 +0100, Nils Philippsen wrote:
> >
> > > Not in the least, there are programs which are supposed to stay running
> > > even when you log out -- screen, vncserver, nohup'ed processes etc.
> >
> > No one is talking about changing the semantics of "nohup".
>
> Perhaps I'm a bit slow, but how would it not do this if it relies on the
> inheritance of a previously non-existent environment variable that needs
> to be deleted if a process shall not be killed on session exit?

Oh I see, I was wrong; yes David was talking about automatically killing
all processes. That is wrong, I agree with you.

As Havoc said, having them connect to X11 or DBus, or using a babysitter
that does is the right way.


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:36 PM
David Zeuthen
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 17:23 +0100, Nils Philippsen wrote:
> On Fri, 2008-01-04 at 11:10 -0500, Colin Walters wrote:
> > On Fri, 2008-01-04 at 16:14 +0100, Nils Philippsen wrote:
> >
> > > Not in the least, there are programs which are supposed to stay running
> > > even when you log out -- screen, vncserver, nohup'ed processes etc.
> >
> > No one is talking about changing the semantics of "nohup".
>
> Perhaps I'm a bit slow, but how would it not do this if it relies on the
> inheritance of a previously non-existent environment variable that needs
> to be deleted if a process shall not be killed on session exit?

The way someone would opt out would be to do this

unsetenv("XDG_SESSION_COOKIE");
if (fork() <= 0)
exit (1);

very early in the program.

David


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:37 PM
Colin Walters
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:29 -0500, David Zeuthen wrote:

> Maybe it's just me, but I think it's a lot easier to just fix the few
> programs such as screen and nohup to opt out of getting reaped..

Unix has had a pretty standard definition of "session" using SIGHUP.
The way programs have historically "opted out" of termination is to
ignore that signal.

I don't think we should change that.

Rather, some programs should be fixed to gain a dep on X11, DBus, or be
run through the babysitter.


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:37 PM
David Zeuthen
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:35 -0500, Colin Walters wrote:
> Oh I see, I was wrong; yes David was talking about automatically killing
> all processes. That is wrong, I agree with you.

Care to explain why this is wrong?

> As Havoc said, having them connect to X11 or DBus, or using a babysitter
> that does is the right way.

So in order to avoid having a process linger we now need to patch it?
Good luck with that....

David


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:40 PM
David Zeuthen
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:37 -0500, Colin Walters wrote:
> On Fri, 2008-01-04 at 11:29 -0500, David Zeuthen wrote:
>
> > Maybe it's just me, but I think it's a lot easier to just fix the few
> > programs such as screen and nohup to opt out of getting reaped..
>
> Unix has had a pretty standard definition of "session" using SIGHUP.
> The way programs have historically "opted out" of termination is to
> ignore that signal.
>
> I don't think we should change that.

Fine so we send a SIGHUP instead of SIGTERM, then SIGKILL. Makes this a
lot easier.....

> Rather, some programs should be fixed to gain a dep on X11, DBus, or be
> run through the babysitter.

Why do you think it's a good idea to add libX11 or libdbus deps to a
program that don't use either? Do you think random upstream projects
would ever take such patches?

David


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:46 PM
Dan Williams
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:35 -0500, Colin Walters wrote:
> On Fri, 2008-01-04 at 17:23 +0100, Nils Philippsen wrote:
> > On Fri, 2008-01-04 at 11:10 -0500, Colin Walters wrote:
> > > On Fri, 2008-01-04 at 16:14 +0100, Nils Philippsen wrote:
> > >
> > > > Not in the least, there are programs which are supposed to stay running
> > > > even when you log out -- screen, vncserver, nohup'ed processes etc.
> > >
> > > No one is talking about changing the semantics of "nohup".
> >
> > Perhaps I'm a bit slow, but how would it not do this if it relies on the
> > inheritance of a previously non-existent environment variable that needs
> > to be deleted if a process shall not be killed on session exit?
>
> Oh I see, I was wrong; yes David was talking about automatically killing
> all processes. That is wrong, I agree with you.
>
> As Havoc said, having them connect to X11 or DBus, or using a babysitter
> that does is the right way.

One problem here is that too many apps set exit-on-disconnect false with
D-Bus to work around bugs in the stupid app where the app gets kicked
off the bus for doing something bad.

dan


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 03:51 PM
David Zeuthen
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:46 -0500, Dan Williams wrote:
> One problem here is that too many apps set exit-on-disconnect false with
> D-Bus to work around bugs in the stupid app where the app gets kicked
> off the bus for doing something bad.

That is a per-connection property and only apps connecting to the system
bus does this. The app would presumably have a libx11 or session bus
connection and that would force to exit(). Otherwise we reap it with
SIGHUP.

(Btw, even though HUP means "Hang Up Now", many programs abuse this
signal to mean "reload config" or "reexec yourself" or whatever the
want. But I guess we can fix that small proportion of programs.)

David



--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 04:01 PM
Colin Walters
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:37 -0500, David Zeuthen wrote:
> On Fri, 2008-01-04 at 11:35 -0500, Colin Walters wrote:
> > Oh I see, I was wrong; yes David was talking about automatically killing
> > all processes. That is wrong, I agree with you.
>
> Care to explain why this is wrong?

See my other mail.

> > As Havoc said, having them connect to X11 or DBus, or using a babysitter
> > that does is the right way.
>
> So in order to avoid having a process linger we now need to patch it?
> Good luck with that....

Don't need luck in the original case you were talking about, just an
editor and commit access to the upstream =)

Here's a patch for GConf:


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 
Old 01-04-2008, 04:04 PM
Colin Walters
 
Default musings on session service mgmt

On Fri, 2008-01-04 at 11:40 -0500, David Zeuthen wrote:
> On Fri, 2008-01-04 at 11:37 -0500, Colin Walters wrote:
> > On Fri, 2008-01-04 at 11:29 -0500, David Zeuthen wrote:
> >
> > > Maybe it's just me, but I think it's a lot easier to just fix the few
> > > programs such as screen and nohup to opt out of getting reaped..
> >
> > Unix has had a pretty standard definition of "session" using SIGHUP.
> > The way programs have historically "opted out" of termination is to
> > ignore that signal.
> >
> > I don't think we should change that.
>
> Fine so we send a SIGHUP instead of SIGTERM, then SIGKILL. Makes this a
> lot easier.....

Sending SIGHUP to all processes manually is fine; in theory actually the
kernel will do this for you when the process session group leader exits.
Now, whether something is correctly set as the process group leader in
the twisted desktop login stack is an open question. A regression here
would mostly be masked by the fact that *almost* everything run from the
desktop does connect to X11.

> > Rather, some programs should be fixed to gain a dep on X11, DBus, or be
> > run through the babysitter.
>
> Why do you think it's a good idea to add libX11 or libdbus deps to a
> program that don't use either? Do you think random upstream projects
> would ever take such patches?

The babysitter is another option. But I think (generally speaking) most
projects nowadays *should* gain a dbus dep, and if we can explain
clearly to them why it it useful, they would accept it.


--
Fedora-desktop-list mailing list
Fedora-desktop-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-desktop-list
 

Thread Tools




All times are GMT. The time now is 10:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org