Score:0

Black screen at login

bo flag

In /etc/profile.d/ I inserted the file custom.sh which reads:

~/.start/speakers.sh &
~/.start/vpn.sh &

As you can see, both files are run in the background. Why am I still experiencing, sometimes but not always, a black screen after I press login? When that happens, I don't see the desktop.

This morning, I had to turn off the computer the hard way, then boot again. This time no problem, the desktop appeared with the speakers connected and the VPN on.

I suspect that's because of ~/.start/vpn.sh &, sometimes the command inside this file pauses for a (very) long time. What I don't understand is, why is this an issue? The file is run in the background.

My OS is Ubuntu LTS 22.04. More info:

systemd-analyze blame | head returns:

6.126s NetworkManager-wait-online.service
2.485s plymouth-quit-wait.service
1.223s apt-daily-upgrade.service
 903ms snapd.seeded.service
 617ms snapd.service
 534ms modprobe@chromeos_pstore.service
 349ms gpu-manager.service
 313ms fwupd.service
 275ms systemd-resolved.service
 254ms systemd-timesyncd.service

ls /usr/bin/*session returns:

/usr/bin/dbus-run-session /usr/bin/gnome-session /usr/bin/gnome-session-custom-session /usr/bin/pipewire-media-session
darth_epoxy avatar
nl flag
Can you post the result of `systemd-analyze blame | head` please? And the separately `ls /usr/bin/*session` also.
Pippin avatar
bo flag
I replied in the OP, thank you.
darth_epoxy avatar
nl flag
Well you have multiple desktop environments installed but none I recognize as crashers. The final entry of your systemd-analyze indicates that the second shell that is executed has some kind of time delay in it. Did you create the .sh files yourself? Can you # out the line with the timer and see if youj get a different boot result?
Pippin avatar
bo flag
Yes I created all `.sh` files myself. I can comment out either line if you like, but since tthe system usually starts without problem, it may take a while for me to get back to you and say if there's any significant change. Would you suggest any other way to run a script in the background, or in another thread?
darth_epoxy avatar
nl flag
I think your startup is OK but booting to a customised desktop environment always has it's problems. Which one are you actually booting to? Type `env | grep XDG_CURRENT_DESKTOP` and it will tell you.
Pippin avatar
bo flag
The answer is `XDG_CURRENT_DESKTOP=ubuntu:GNOME`
darth_epoxy avatar
nl flag
OK then that's the default, nothing to worry about. I think it's just a delay of some kind caused by your startup scripts.
Pippin avatar
bo flag
Ok thanks, but in the end, we have no idea what's wrong with the system. A background script should not delay anything between logging in and accessing to the desktop.
Pippin avatar
bo flag
What exactly is the order in which the folder `/etc/profile.d/` is run? Is it possible that the scripts in it are run too early? That must be the cause. I think I would solve my problem if I could run those scripts right after the desktop is shown.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.