2

I am able to log into Ubuntu Wayland (20.04) but I am having a problem with regular Ubuntu. I have been advised to "read log files like dmesg or syslog".

My question is, if I run these in Wayland, will that help figure out what's going on in regular Ubuntu or do I have to log into regular Ubuntu in recovery mode and then read the log files in there?

(For context: my original post).

user1551817
  • 97
  • 2
  • 3
  • 14
  • 4
    You can use `dmesg` or `journalctl` from terminal anywhere (text terminal, GUI be it Wayland, Xorg etc session); however if you reboot (into recovery mode), you'll only be reading the messages from the current session (ie. from boot) using `dmesg` as they do not survive shutdown/reboot. – guiverc Jan 07 '22 at 10:39
  • @guiverc thank you. Hmmm. So my problem occurs when I log in to "regular Ubuntu" (everything freezes). Does that mean that my log files in Wayland or recovery mode Ubuntu won't be of any use? – user1551817 Jan 07 '22 at 10:53
  • 1
    Depends what you mean by *freezes*.. If the desktop is frozen; you should still be able to speak directly to the kernel via keyboard (sysrq keys etc) & I'd still expect you can switch to text terminal via Ctrl+Alt+F4 for example.. but systemd journals (`journalctl`) will survive reboot ... is freeze kernel level (ie. SysRq commands no longer work) or just GUI (ie. mouse/keyboard no longer seem to work as nothing changes on display; but keyboard commands to non-GUI will still work) – guiverc Jan 07 '22 at 11:02
  • @guiverc thank you. So I just checked. When logging into regular Ubuntu, I tried `Ctrl+Alt+F4` and that did NOT bring up a terminal (and it does when I am in Wayland). However, the keyboard must work somewhat because I can `Alt+SysRq+b` to reboot the machine. – user1551817 Jan 07 '22 at 11:18
  • So I think from what you have said: because the SysRq keys do still work, this is only a GUI-level freeze (although I can't open a terminal either). – user1551817 Jan 07 '22 at 11:21
  • If you've got a spare computer, `sudo apt install openssh-server` to install an SSH server, then from your spare computer type `ssh username@192.168.1.x -o PreferredAuthentications=password` to login while you try to repro the crash on your server. You can check dmesg and other commands comfortably. From client you can also do `sshfs username@192.168.1.x:/ /mnt -o default_permissions,idmap=user` to mount your root in /mnt and from there check `/mnt/var/log/Xorg.0.log – Matias N Goldberg Jan 14 '22 at 01:24

1 Answers1

2

The logfiles of your system record what has been going on with your system, irrespective of the way you happen to log in (on a TTY, over SSH, in Gnome Shell, in xfce... So yes, inspection of your log files from within another session is relevant.

System log files are being stored for a certain time. By default, they are archived every 7 days. By default up to four cycles of these archives are preserved. So you can look back into the system logs for about the past month.

vanadium
  • 82,909
  • 6
  • 116
  • 186