Score:0

Why does logging out of a Virtual Console crash the desktop GUI?

br flag

Bionic Beaver, 18.04.

A funny thing happened today. I have a system, working fine, booted up to the desktop - uptime about 80 days, lots of windows open on the desktop. Everything fine, until... GUI is running on tty1 (as expected).

In trying to debug another problem, I decide to switch away from the desktop GUI to a virtual console and login. So,I do "sudo chvt 2" and get to the login prompt on tty2. So far, so good. I log in as myself (on tty2), do a few things, then logout (via ^D) - expecting to get back to a login prompt, from which I can then switch back to my GUI desktop session.

However, next thing that happens is that I am presented with a pure purple screen, then about 10 seconds later, a GUI screen asking for my password. I log in and am presented with a clean, fresh desktop. All windows that had previously been there are gone (meaning, I have to figure out what was there before, and restart everything).

It looks like somehow, logging out of tty2, sent a Hangup signal to all the processes running on the GUI desktop, including the desktop itself, forcing you to log in again and restarts whatever had been running before.

Why does this happen?

Some additional information:

  1. After the desktop re-start - and after I've run my scripts to open up my usual windows (programs) - I find that there are a maze of processes running on tty1, running as user "gdm", and also a maze of processed on tty3, running as user "me". All of these processes (on both tty1 and tty3) show as being started at the time of the desktop re-start. There is a single process (a getty) running on tty2.

  2. There is a single file in /var/crash, timestamped at the time of the desktop re-start, that corresponds to one of my processes (i.e., something I had running in one of my terminal windows at the time of the crash). That file shows it to have been killed by signal 6 (SIGABRT). SIGABRT is usually caused by a program failing an assert(3).

ar flag
Note that `tty1` is the login screen and `tty2` is the X GUI sesson. It looks like you just logged out of your Xorg sesson.
br flag
No, it is the other way around. You can tell from a ps listing that all of the GUI processes are running on tty1. I was definitely logging into a fresh new virtual console (tty2). There is no doubt that these are the facts.
ar flag
No. You can tell by pressing [Ctrl]+[Alt]+[F1] for the login screen; [Ctrl]+[Alt]+[F2] for the Desktop; and, [Ctrl]+[Alt]+[F3] for the `ttl3`. If you are using a laptop you may have to add the [Fn] key into the mix.
user535733 avatar
cn flag
Was a .crash file generated in /var/crash? What does your syslog say around the time of logout?
ar flag
See [this question](https://askubuntu.com/questions/1138357/how-to-enable-switch-back-to-running-gui-from-tty-in-18-04/1157668#1157668) and [this question](https://askubuntu.com/questions/1048492/accessing-different-tty-in-ubuntu-18-04) for more.
br flag
I think you are missing the point. Really, this has nothing to do with any Ctrl/Alt/Anything. Seriously.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.