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

[pending] /etc/ly/wsetup.sh exits unsuccessfully with TCSH #602

Open
ghost opened this issue May 4, 2024 · 28 comments
Open

[pending] /etc/ly/wsetup.sh exits unsuccessfully with TCSH #602

ghost opened this issue May 4, 2024 · 28 comments
Labels
bug This issue or pull request discusses a bug

Comments

@ghost
Copy link

ghost commented May 4, 2024

Hello,
After the changes implemented in 0.12.0, I was finally able to get the zig rewrite of ly to compile.
I set up the systemd service using the recommended method (zig build installsystemd) and made some changes to /etc/ly/config.ini (enable an animation, set a clock format, and change the masking text from * to -).
However, upon a reboot, a few things happened:

  • I can see ly. This is great!
  • There is a stray cursor flashing in the top left of the screen maybe 30 columns over and 20 rows down (but I didn't count). This only goes away when I hit an arrow key to move to the password field or change the selected desktop environment.
  • No animation is displayed, which is less than ideal - and the reason I moved away from the main branch (see Animations not loading on TTY (Arch, 6.8.2-arch2-1, Ly version v0.6.0.r0.g1c2be47) #592). In addition, the other changes I made to the config file are not visible either.
  • Finally, when I actually attempt to enter a password, I am greeted with the following...
    exception (no address available)
    ??:?:?: -x73e4ee88709d in ??? (libc.so.6)
    Unwind information for 'libc.so.0x73e4ee88709d' was not available, trace may be incomplete
    ... displayed atop the ly prompt -- so, I am unable to get to sway or i3 via ly, and I have to switch to a different tty and start it manually.

Additional info:
uname: Linux my_fqdn 6.8.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 May 2024 17:49:46 +0000 x86_64 GNU/Linux
latest commit hash in my clone of ly: 629749b3832aaec86929794a527c108e5c1c29d1
init system: systemd
desktop environments tested: i3 and sway

If there are any other questions I can answer or things I can test, let me know. Thanks!

@Kawaii-Ash
Copy link
Contributor

I can't seem to reproduce the exception you're getting and I can successfully login on an arch vm into sway.
Could you possibly list some steps that leads to the exception occurring so I can reproduce it?

My latest pr should fix the config issue u were having.

@ghost
Copy link
Author

ghost commented May 4, 2024

I can't seem to reproduce the exception you're getting and I can successfully login on an arch vm into sway. Could you possibly list some steps that leads to the exception occurring so I can reproduce it?

My latest pr should fix the config issue u were having.

Hi there,
Thanks for getting back so quickly. I'll be able to be more specific on Monday when I'm back at my PC, but here are the steps I took:

  • Clone ly
  • Checkout zig branch
  • Verify the latest version is pulled
  • zig build
  • zig build installsystemd
  • Enable ly.service
  • reboot

Nothing fancy/that I think should cause this, but I was then unable to sign in with the error mentioned above.
While I won't be at my machine physically for a few days, if there are any logs/details I can grab/share remotely let me know and I will.

@Kawaii-Ash
Copy link
Contributor

My latest PR "should" allow you to login.

Let me know if the issue still occurs when you can.

@ghost
Copy link
Author

ghost commented May 5, 2024

Thanks!
There's a chance I'll be at my computer tomorrow, if I am I will check and let you know -- else Monday.

@ghost
Copy link
Author

ghost commented May 5, 2024

@Kawaii-Ash I am now successfully seeing my config changes applied to my login screen.
When I attempt to log in, the more verbose error is gone.
However, there is no evidence of a sway session even attempting to start, and I am told "logged out" in the space above the username field.
In addition, the cursor in the corner is still there when I do not have an animation applied (see attachment).

IMG_0197.mov

@ghost
Copy link
Author

ghost commented May 5, 2024

trim.4F96F924-1501-4289-B34B-1F11F9F36D11.MOV

... and here is a video of my attempt to sign in to an unconfigured ly session and start sway.
I also notice that the default value of "false" for clear_password in config.ini does not seem to be doing much of anything (though I would ordinarily set it to true).

@AnErrupTion
Copy link
Collaborator

AnErrupTion commented May 5, 2024

... and here is a video of my attempt to sign in to an unconfigured ly session and start sway.

It seems like Sway is crashing here (though I may be wrong). Just to confirm, are you able you launch Sway from a TTY?

@ghost
Copy link
Author

ghost commented May 5, 2024

... and here is a video of my attempt to sign in to an unconfigured ly session and start sway.

It seems like Sway is crashing here (though I may be wrong). Just to confirm, are you able you launch Sway from a TTY?

Yes, I have no issue opening sway from a tty. I've also verified that ly is looking in the right directory for my .desktop file.

@Kawaii-Ash
Copy link
Contributor

Kawaii-Ash commented May 5, 2024

I could reproduce this in an arch vm only when I didn't have polkit installed.
Is your case the same or is it something else?

@ghost
Copy link
Author

ghost commented May 5, 2024

That could be it, I'm not sure if I have polkit installed on this system or not. I will check this evening.
I don't seem to see polkit as a dependency listed in README, fyi -- but I'll look into this asap.

@Kawaii-Ash
Copy link
Contributor

Alternatively, adding my user to the "seat" group and restarting seatd also allows me to launch sway as an alternative to installing polkit.

But without doing either, I have the same issue starting sway from a tty when I'm not root. But apparently you have no issue opening sway from a tty.

Other than that, I'm not really sure what the issue is.

@ghost
Copy link
Author

ghost commented May 6, 2024

It looks like I have polkit installed and running already. Adding myself to the seat group and restarting seatd + rebooting didn't seem to affect anything either. And yet, I am still able to start sway just fine from a tty.

@Kawaii-Ash
Copy link
Contributor

If you redirect stderr to a file, like:
sudo zig-out/bin/ly 2> o.txt

Then try to login to sway, does the file contain anything?

@AnErrupTion
Copy link
Collaborator

Ah yes, wlroots-based WMs like labwc and sway have issues when polkit and D-Bus aren't installed. Check that the latter is installed (it should be, but just to make sure).

If that's OK, I recommend redirecting and checking stderr like Ash suggested. If it says anything about the former 2 dependencies (or if it doesn't say anything useful), try prepending this command to the Exec line of your Sway desktop file:

dbus-run-session

@AnErrupTion AnErrupTion added the bug This issue or pull request discusses a bug label May 6, 2024
@ghost
Copy link
Author

ghost commented May 6, 2024

I have both polkit and dbus installed and running.
On attempting to redirect errors to a file, running ly and trying to start sway, no errors are generated, both when I use dbus-run-session and when I do not.

@AnErrupTion
Copy link
Collaborator

That's interesting... so it doesn't work with dbus-run-session either? Sometimes quite wrong here then. How did you end up installing Arch+ly+Sway, so that we could try to reproduce this behavior as perfectly as possible? @amberjennings

@ghost
Copy link
Author

ghost commented May 6, 2024

I installed Arch from the official iso, looks like this system was set up in August 2023 so the 2023.08.01 image. I keep my packages up to date, though, so I'm not sure that's super relevant. Sway would've just been installed via Pacman, and ly via this repository and zig build/zig build installsystemd. Not sure how helpful this is but let me know if you have more questions.

@Kawaii-Ash
Copy link
Contributor

Could you edit your config file and change wayland_cmd = /etc/ly/wsetup.sh to just wayland_cmd = to see if it makes any difference?

@ghost
Copy link
Author

ghost commented May 6, 2024

This seems to have done it! I do use tcsh and I'm not sure how extensively that block is tested. I notice that it's not checking for ~/.cshrc alongside /etc/csh.login and ~/.login though I don't know if that means much.
But in the meantime, this issue is resolved. Thank you both again!

@ghost ghost closed this as completed May 6, 2024
@ghost
Copy link
Author

ghost commented May 7, 2024

I guess maybe this should stay open until the repository is updated to fix this. But my personal situation is resolved.

@ghost ghost reopened this May 7, 2024
@AnErrupTion AnErrupTion changed the title [zig] Unable to sign in and start desktop environment /etc/ly/wsetup.sh exits unsuccessfully May 7, 2024
@AnErrupTion AnErrupTion changed the title /etc/ly/wsetup.sh exits unsuccessfully /etc/ly/wsetup.sh exits unsuccessfully with TCSH May 7, 2024
@AnErrupTion
Copy link
Collaborator

@amberjennings We're both unable to reproduce your issue with TCSH changed as the default shell for all users. Do you have a custom TCSH configuration perhaps? And, just to make sure (but I can probably guess the result), what's the output of echo $SHELL in a TTY?

@ghost
Copy link
Author

ghost commented May 7, 2024

@amberjennings We're both unable to reproduce your issue with TCSH changed as the default shell for all users. Do you have a custom TCSH configuration perhaps? And, just to make sure (but I can probably guess the result), what's the output of echo $SHELL in a TTY?

amber@shruikan ~ % echo $SHELL
/bin/tcsh
amber@shruikan ~ % cat .cshrc
alias ls  		ls --color
alias l   		ls -al
alias ll  		ls -l
alias g   		git
alias em  		emacs
alias sget		spotdl --bitrate 320k download

setenv	EDITOR	emacs

if (`uname` == "Linux") then
 setenv PATH  "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/amber/.local/bin"
endif

if (`uname` == "Darwin") then
 setenv PATH  "/opt/homebrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/Users/amber/.local/bin"
endif

if (-e ~/.hushmotd) then
	rm -f ~/.hushmotd
endif


set     red="%{\033[1;31m%}"
set   green="%{\033[0;32m%}"
set  yellow="%{\033[1;33m%}"
set    blue="%{\033[1;34m%}"
set magenta="%{\033[1;35m%}"
set    cyan="%{\033[1;36m%}"
set   white="%{\033[0;37m%}"
set     end="%{\033[0m%}"

set prompt="${blue}%n${white}@${blue}%m ${cyan}%~ ${white}%%${end} "
unset red green yellow blue magenta cyan yellow white end
umask 077

@AnErrupTion
Copy link
Collaborator

@amberjennings Well that's awkward, I'm still unable to reproduce the bug. I think it might be easier for you to try to mess with the wsetup.sh script, in particular with the TCSH configuration part, to maybe find what's wrong (and perhaps we'll be able to better deduce what's wrong later on).

@ghost
Copy link
Author

ghost commented May 9, 2024

Yeah, I can do that. No promises on timeline as I am quite busy but if you want to assign to me I'll do what I can.

@AnErrupTion
Copy link
Collaborator

Yeah, I can do that. No promises on timeline as I am quite busy but if you want to assign to me I'll do what I can.

No pressure! I feel like assigning yourself to an issue you reported is kind of odd though... but I'll edit the title of the issue to reflect its "pending" status.

@AnErrupTion AnErrupTion changed the title /etc/ly/wsetup.sh exits unsuccessfully with TCSH [pending] /etc/ly/wsetup.sh exits unsuccessfully with TCSH May 9, 2024
@ghost
Copy link
Author

ghost commented May 9, 2024

I'm attempting to find the source referred to in wsetup.sh (kde-workspace/kdm/kfrontend/genkdmconf.c) and it looks like the kde-workspace repository was shuttered 9 years ago in favor of plasma-workspace, and even then I cannot locate that file. I realize that this is a part of the original C version of ly and not put in place by you, but also, if telling it not to run at all makes the program work, with some more testing, could it be phased out entirely?

@AnErrupTion
Copy link
Collaborator

if telling it not to run at all makes the program work, with some more testing, could it be phased out entirely?

Well, it sources the profile for the logged in user's shell. Yes, it can work just fine without it, however it can be useful if you want to run something specific right before your DE/WM starts. Granted, I don't believe the current shell code for sourcing the logged in user's shell profile is that much useful anymore (or maybe it is, like if that sets up some specific stuff that the DE/WM can use while starting?).

With all of that said, you also have to keep in mind that xsetup.sh exists as well, which fills an even more important purpose because it sources an X11-specific profile (which may or may not be needed by the DE/WM), but more importantly, it calls xrdb -merge on X11 resource files.

So at the end of the day, I think it's probably best to try and fix the issue at hand, or at least try to find why the script doesn't work with your specific setup.

@ghost
Copy link
Author

ghost commented May 9, 2024

Yeah, I can see the use case, I'm just not sure why it's entirely preventing me from starting a desktop session. Just running the script on its own works fine (because all its doing is sourcing environment variables that already exist, aiui). The xsetup script is definitely more integral.

/etc/csh.login has some interesting stuff happening:

if ( -o /dev/$tty && ${?prompt} ) then
    # Console
    if ( ! ${?TERM} )           setenv TERM linux
    if ( "$TERM" == "unknown" ) setenv TERM linux
    # No tset available on SlackWare
    if ( -x "`which stty`" ) stty sane cr0 pass8 dec
    if ( -x "`which tset`" ) tset -I -Q
    unsetenv TERMCAP
    settc km yes
endif

/etc/csh.cshrc seems mostly uninteresting, but it exists as well.
When I get some time I will try modifying wsetup.sh and doing some more testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request discusses a bug
Projects
None yet
Development

No branches or pull requests

2 participants