Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cinnamon doesn't log to .xsession-errors when started through startx #10023

Closed
jpegxguy opened this issue Mar 31, 2021 · 1 comment
Closed

Cinnamon doesn't log to .xsession-errors when started through startx #10023

jpegxguy opened this issue Mar 31, 2021 · 1 comment

Comments

@jpegxguy
Copy link

jpegxguy commented Mar 31, 2021

 * Cinnamon 4.8.6
 * Arch Linux
 *AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx, amdgpu
 * 64 bit
 * Log file... This is kind of the issue

Issue

It's useful to have access to a logfile for debugging in the case of Cinnamon crashing, but it seems that this logging doesn't happen when using startx/xinit, while it works upon testing with lightdm (and I suspect it will work with compliant display managers. I noticed this yesterday, seeing that xsession-errors had not been modified since October 2020.

This is also important because Melange only shows the log from the latest start, onwards, so it can't be used to trace a crash. IT seems like Dbus is used to view the log though Melange.

The Cjs messages e.t.c. (the normal things that you'd see in the log file) are instead printed out to the startx terminal, probably on stderr, considering these 2 suspicious environment variables are set when running cinnamon though startx:

GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG

These environment variables are set by cinnamon in src/main.c, but they are NOT set at all when launching through lightdm. Weird.

My workaround for now is to redirect the output of startx like so, in my .profile:

mv ~/.xsession-errors-startx ~/.xsession-errors-startx.old
startx &> ~/.xsession-errors-startx

It does seem like the information I would find in .xsession-errors normally, gets printed in my new file. I tested with a Forced crash through Melange

This is my .xinitrc:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# Merge in defaults and keymaps

[ -f $sysresources ] && xrdb -merge $sysresources
[ -f $sysmodmap ] && xmodmap $sysmodmap
[ -f "$userresources" ] && xrdb -merge "$userresources"
[ -f "$usermodmap" ] && xmodmap "$usermodmap"

# Source extra scripts

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
        for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
                [ -x "$f" ] && . "$f"
        done
        unset f
fi

# Environment variables
[ -f ~/.xprofile ] && . ~/.xprofile

# Handled in autostart
# https://wiki.archlinux.org/index.php/GNOME/Keyring#Without_a_display_manager
#eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
#export SSH_AUTH_SOCK

# Start DE/WM
exec cinnamon-session-cinnamon

I have played around with the aforementioned environment variables:

  • unsetting GJS_DEBUG_OUTPUT (no change, it gets set to "stderr")
  • setting it to something random (it gets set to "stderr")
  • setting it to "$HOME/.xsession-errors" (the change persisted but no change in behavior, no modification to the file itself)

Steps to reproduce

  • Run cinnamon-session (or the wrapper cinnamon-session-cinnamon, same thing), trough startx/xinit.
  • Cinnamon logs messages in the tty (you cannot see this until you exit Cinnamon, or briefly before restarting

Expected behaviour

Cinnamon logs to the .xsession-errors file as normal

Other information

I originally opened a thread about this in the Cinnamon subsection of the Linux Mint forums

@leigh123linux
Copy link
Contributor

We don't support startx usage, the DM is meant to set it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants