Wednesday, February 28, 2024

Enable/Disable wayland

==

// To check whether wayland / X11 

$ echo $XDG_SESSION_TYPE

x11

==
// To update wayland / x11

$ sudo gvim /etc/gdm3/custom.conf 

  // edit the line 

// this means x11

WaylandEnable=false


// and this means wayland

WaylandEnable=true

==

// To check after update - after reboot 

$ echo $XDG_SESSION_TYPE

==

Monday, February 19, 2024

syslog vs dmesg

Understanding /var/log/syslog and its Relation to dmesg

Both /var/log/syslog and dmesg play crucial roles in logging system activity on Linux-based systems, but they have distinct purposes and relationships. Here's a breakdown:

What is /var/log/syslog?

  • This file acts as a central repository for various system logs originating from diverse sources like:
    • Users & applications
    • Background services (daemons)
    • System startup and shutdown processes
    • Kernel messages (after the system is fully booted)
  • Syslog offers flexibility by allowing different log messages to be directed to specific log files within the /var/log directory based on predefined rules.
  • This categorization facilitates targeted troubleshooting for specific areas of the system.

What is dmesg?

  • Dmesg is a command-line tool that displays the contents of the kernel's ring buffer, a temporary storage for early boot messages and kernel-related activity.
  • This buffer is volatile and resets upon system reboot, meaning dmesg only shows currently ongoing kernel activity.
  • Dmesg isn't a file; it's a real-time snapshot of the kernel ring buffer.

Relationship between /var/log/syslog and dmesg:

  • While syslog captures various system logs, dmesg focuses specifically on kernel messages.
  • Early boot messages, before syslog starts, are only accessible through dmesg.
  • Once syslog is operational, kernel messages are also directed to /var/log/syslog by default.
  • So, dmesg offers a real-time glimpse of kernel activity, while /var/log/syslog provides a more comprehensive historical record of various system events, including kernel messages.

Key differences:

Feature/var/log/syslogdmesg
ScopeDiverse system logsKernel messages
PersistencePersistent across rebootsVolatile, resets on reboot
Real-time viewNot directlyYes
Specific fileYes (individual files for categories)No (command-line tool)


Note: I got the above from google gemini while looking about syslog and dmesg.