Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GNOME butchers all programs when I log out
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Monq
n00b
n00b


Joined: 11 Feb 2011
Posts: 40
Location: Spain

PostPosted: Thu Mar 30, 2017 9:16 am    Post subject: GNOME butchers all programs when I log out Reply with quote

I mean to say, it just kills them immediately. Is there a way to tell GNOME to be more gentle? For example, send them a SIGTERM, wait a few seconds, then send a SIGKILL?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Thu Mar 30, 2017 8:01 pm    Post subject: Reply with quote

No, it's a vicious little gnome...

Are there any specific applications you're worried about?

Most DEs don't actually send a term or kill your applications. It stops the controlling thread of your X server, and X subsequently quits, and then your applications will notice the X server pipe closed and then die when that happens. Ideally the applications should notice when the pipe closes and cleans up itself.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6276

PostPosted: Fri Mar 31, 2017 12:48 am    Post subject: Reply with quote

eccerr0r wrote:
Most DEs don't actually send a term or kill your applications.

Actually for GNOME under systemd (as I assume) it is probably rather different: All applications are started in the same cgroup, and the whole cgroup is destroyed when the session is left. This even applies to things like "screen", "tmux", "nohup", etc, which are normally not killed when a DE is left.
IIRC, there is some option in some file from /etc/systemd/*.conf which controls this behavior.
Alternatively, if you have root permissions, you can also echo the PIDs of the jobs you want to keep to /sys/fs/cgroup/systemd/user.slice/tasks
Without root permissions and without the adminstrator setting the systemd options, it is not possible to keep jobs in the background running: This is so, because this might be undesired in some machine pools.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Fri Mar 31, 2017 7:13 am    Post subject: Reply with quote

Oh gawd, logind plus those cgroups, forgot about that. That's sure annoying. I don't know, then again I've heard of annoying sysadmins that absolutely do not want people leaving "unapproved" nohup jobs on any machines in the server farm and thus would love this functionality instead of running a cronjob that kills everything... Oh no... a bastard sysadmin who would like systemd cgroups? *shiver*

Also I don't have any idea what wayland does when its control thread quits. I suspect something needs to signal to all applications and chances are, just like traditional X, the kernel will signal.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Monq
n00b
n00b


Joined: 11 Feb 2011
Posts: 40
Location: Spain

PostPosted: Fri Mar 31, 2017 9:04 am    Post subject: Reply with quote

I haven't got a clue about the intricacies of the system, but what I do know is that applications are forcefully killed.

When I log back in, Firefox often shows me its "oops I've crashed, let's try and restore your tabs" screen. I also use an IRC client and instead of showing my quit message when I log out, it shows a message that clearly implies the application was killed.

So I was wondering if I was missing a package, or maybe a USE flag, or some configuration option, because this behaviour is not sane.

Yes I use systemd, but without wayland.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Fri Mar 31, 2017 6:55 pm    Post subject: Reply with quote

As a note to self, to tell the difference between systemd killing versus X killing, try running firefox like this:

$ systemd-run --user --scope firefox

Then logout and see if the behavior is different.

I just tried logging out with firefox running on xfce4 (systemd) without the above, and firefox actually remembered the session without indicating it died... Hmm...was unexpected (to me) behavior...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Fri Mar 31, 2017 10:28 pm    Post subject: Reply with quote

The ususal behaviour is to kill everything when you log out, or the X server dies

I do not get your point.

Why should the "apps " keep on running / consume power / consume hardware memory.

log out vs switch user (which afaik gnome 2 supported at some point)

you have to start it differently when you want to keep your processes regardless of the x-server
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Sat Apr 01, 2017 12:38 am    Post subject: Reply with quote

The OP wants each individual app to get a chance to save state and/or do self cleanup if it wants to trap the signal to die.

Right now, the combination of gnome+systemd (most likely) is simply kill -SIGKILL the programs and thus disallow the save termination of the programs. Theoretically the suggested run will tell systemd to NOT kill firefox -- but firefox will still die because it will lose connection to the terminating X server. However it may trap that and save state properly.

I don't know if this is common knowledge that programs should never be given SIGKILL unless the program is doing harm and not otherwise responding due to traps (SIGTERM can be trapped). Thus I don't know why systemd is doing this...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum