You are not logged in.

#1 2021-11-02 05:54:48

TheJaava
Member
Registered: 2021-07-05
Posts: 69

[SOLVED] session ending right after it starts

After one update that broke arch linux I suddenly could not start xmonad. The issue was a haskell thing. I uninstalled the official repository version of xmonad and built it from source. I've since moved away from lightdm and I now use sddm and I have it configured pretty nicely already with the sddm-slice theme. I am getting the same issue, still, though.

So, here is the issue in detail:
When I boot up, sddm starts and it looks and acts normal. When I log in, though, the screen goes black like it is starting the session, then I get a blinking cursor and get kicked back into sddm. I can switch tty's and startx, and xmonad starts. It's also worth noting that I am using the aur package xinitrc-xsession which starts a session and executes ~/.xinitrc. .xinitrc is executable.

Here is the journal entry. You can see the session created and then immediately closed after it is setup.

[EDIT:
I've since tried a couple things so I'll update here until I find the issue.
I made sure that ~/.xinitrc is executable for all users, in case that were some kind of bug with xinitrc-xsession.
I moved my settings.conf from /usr/lib/sddm/sddm.conf.d/ to /etc/sddm.conf.d/ in case running the config for the global system made ~/.xinitrc ambiguous (if $HOME is not set)
I tried this but every time I log in .Xauthority is recreated. Is this what they meant?
]

Let me know if you have any ideas!

Last edited by TheJaava (2021-11-02 14:51:14)

Offline

#2 2021-11-02 07:47:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] session ending right after it starts

Please post the xinitrc.
I'd try to make it "exec xterm" and start xmonad from there - which will likely get you some errors instead of the WM?

Offline

#3 2021-11-02 13:55:56

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

My xinitrc is bare bones, because I wasn't using it before. As of right now it contains:

#!/bin/bash
exec st
exec xmonad-x86_64-linux

Good call on the terminal line, because now it logs me in as expected with a st window. xmonad doesn't start, though. When I run xmonad-x86_64-linux from the st window it starts, though.

[Edit: Adding a & after "exec st" so that "exec xmonad-x86_64-linux" is run gets me the original issue with no st window to read errors from.]

Last edited by TheJaava (2021-11-02 14:01:11)

Offline

#4 2021-11-02 14:16:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] session ending right after it starts

[Edit: Adding a & after "exec st" so that "exec xmonad-x86_64-linux" is run gets me the original issue with no st window to read errors from.]

Yeah, that's not how it works tongue

xmonad doesn't start, though. When I run xmonad-x86_64-linux from the st window it starts, though.

What was the plan here?

st -e xmonad-x86_64-linux

will run st and have it execute xmonad-x86_64-linux

Since xmonad-x86_64-linux runs out of st (resp. the interactive shell inside) but not from the xinitrc, I assume it's some environment variable.
You could add "printenv > /tmp/xinitrc.env" before the "exec st" call and compare that w/ the output of "printenv" inside the shell run by st.

Offline

#5 2021-11-02 14:21:57

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

seth wrote:

What was the plan here?

Good question lol

st -e xmonad-x86_64-linux

will run st and have it execute xmonad-x86_64-linux

That's better smile

Since xmonad-x86_64-linux runs out of st (resp. the interactive shell inside) but not from the xinitrc, I assume it's some environment variable.
You could add "printenv > /tmp/xinitrc.env" before the "exec st" call and compare that w/ the output of "printenv" inside the shell run by st.

xmonad-x86_64-linux is a executable in ~/.xmonad/ (which is in $PATH)

Offline

#6 2021-11-02 14:27:24

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

exec st -e xmonad-x86_64-linux

This gives me a black screen with a mouse cursor that I can move around. I cannot do anything.

When I run startx from tty it works exactly as expected running xmonad in a terminal and if i close the terminal, X exits.

Offline

#7 2021-11-02 14:29:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,501
Website

Re: [SOLVED] session ending right after it starts

TheJaava wrote:

xmonad-x86_64-linux is a executable in ~/.xmonad/ (which is in $PATH)

But is it?  Where is this added to the PATH variable?  I'm guessing this is added from a shellrc file which would explain all your symptoms.  In any case, the above-mentioned environment variable test would remove a lot of guess work.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2021-11-02 14:36:05

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

I'm pretty sure I found the issue. The environment variables are different. /tmp/xinitrc.env does not have /home/nick/.xmonad/ in the path. So I can fix this by just changing .xinitrc to ~/.xmonad/xmonad-x86_64-linux.

But do you think you could help me understand why my path variable is not accurate at this stage?

Offline

#9 2021-11-02 14:36:59

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

Trilby wrote:
TheJaava wrote:

xmonad-x86_64-linux is a executable in ~/.xmonad/ (which is in $PATH)

But is it?  Where is this added to the PATH variable?  I'm guessing this is added from a shellrc file which would explain all your symptoms.  In any case, the above-mentioned environment variable test would remove a lot of guess work.

Yes, you were exactly right.

Offline

#10 2021-11-02 14:40:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] session ending right after it starts

As Trilby pointed out, you're probably exorting that PATH from your interactive shell rc, but that is not what runs the xinitrc.
You can either export the path there or in a more general profile, eg. /etc/profile*, ~/.profile or ~/.xprofile - https://wiki.archlinux.org/title/Environment_variables

Offline

#11 2021-11-02 14:42:41

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

Xmonad starts now with only "exec ~/.xmonad/xmonad-x86_64-linux" but for some reason it does not have xmobar. Anything jump out to you for that? It always worked before.......

Offline

#12 2021-11-02 14:43:36

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

seth wrote:

As Trilby pointed out, you're probably exorting that PATH from your interactive shell rc, but that is not what runs the xinitrc.
You can either export the path there or in a more general profile, eg. /etc/profile*, ~/.profile or ~/.xprofile - https://wiki.archlinux.org/title/Environment_variables

Ok that makes sense. Thank you.

Offline

#13 2021-11-02 14:45:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] session ending right after it starts

type xmobar

Offline

#14 2021-11-02 14:50:54

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

seth wrote:
type xmobar

xmobar is started by xmonad. Not sure what stopped it from working, but I moved my relevant environment variables from .bashrc to .xprofile and then I sourced .xprofile before starting xmonad. Now xmobar starts as well. It looks like everything is working properly. I'm going to mark this as solved. Thanks for your help again!

Offline

#15 2021-11-02 14:52:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] session ending right after it starts

lmg: "type xmobar" would have said ~/.xmonad/xmobar?
That's why.

Offline

#16 2021-11-02 15:01:10

TheJaava
Member
Registered: 2021-07-05
Posts: 69

Re: [SOLVED] session ending right after it starts

seth wrote:

lmg: "type xmobar" would have said ~/.xmonad/xmobar?
That's why.

Oh, I guess that makes sense, because in xmonad the command is just "xmobar" and before (instead of sourcing .xprofile containing the environment variables) my fix was just to use the whole path of xmonad. Thank you. I would not have even thought of that if you didn't say something.

Offline

Board footer

Powered by FluxBB