User avatar
Posts: 7640
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Why is this login prompt randomly appearing?

Tue Jan 03, 2023 11:39 pm

Not helpful, but I'd like to point out that the link to the switched cable you posted is for micro-USB, which won't work on a Pi4B without adapters (and won't be able to deliver the Pi4 recommended 3A of current). Assuming you meant this one:

While swap will help in many cases, it's not bulletproof. Swapping could hang the system long enough for something to time out. To determine if it's actually a RAM issue it would be best to test on a system with more memory, so if you happen to have a Pi4B with more RAM, testing with that system could be helpful. If you don't have another Pi4B, ZRAM might help.

Other random suggestions and thoughts...
  • Pi computers don't consume much power, do you really have to shut it down at night? Try removing that timer switch and disabling the cron job shutdown to see if the system stays up (at the very least it might crash faster making troubleshooting less time-consuming).
  • Again, probably not helpful to you, but my personal opinion is that mechanical power switches on the low voltage side are a bad idea. Not only is low voltage less able to overcome resistance that develops over time and use as the switch accumulates dust or tarnish on the contacts (or they wear out), it also doesn't stop the "ghost load" of power supplies that are not in active use. Disconnecting from the high voltage mains side with an outlet tap switch (or switched power strip or surge protector) resolves both of those issues.
  • I also agree that a reboot would not cause random login prompts to appear. It must be a service restarting and not a full reboot (which you seem to be thinking now as well).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

Posts: 15
Joined: Mon Oct 10, 2022 7:05 am

Re: Why is this login prompt randomly appearing?

Wed Jan 04, 2023 6:36 pm

Thanks very much for the thoughts.

You are correct about the switched USB cable; I accidentally linked to the wrong one, and the one you linked to is indeed the one I was using.

Those are some useful tips about power, I'll certainly bear those in mind. As it stands though, there's no evidence of any power issues. It seems like the problem is lightdm is crashing but I have no idea why. My initial thought is that kiosk mode is perhaps involved, but it's just a guess.

I think I'll try and trigger a reboot if lightdm crashes, as that is the only potential solution I have right now while I do some more digging.

If anyone else has any thoughts on the lightdm side of things that would be great.

Posts: 2866
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Why is this login prompt randomly appearing?

Wed Jan 04, 2023 6:47 pm

It's not clear that lightdm is actually crashing. It could be the session manager dying, which causes lightdm to exit.

Code: Select all

[+1207.97s] DEBUG: Session pid=634: Exited with return value 1
[+1207.97s] DEBUG: Seat seat0: Session stopped
Is there anything useful in ~/.xsession-errors or /var/log/Xorg.0.log?
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards:
Easily run and manage your network's DHCP/DNS servers on a Pi:
Easy and secure IPSEC/IKEV2 VPN installer/manager:
Lightweight Virtual VNC Config:

Posts: 15
Joined: Mon Oct 10, 2022 7:05 am

Re: Why is this login prompt randomly appearing?

Thu Jan 05, 2023 1:56 pm

I will have to check next time I can access the Pi and hope that the logs haven't been overwritten.

In lightdm/x-0.log - which I did save - I can see:

Code: Select all

error: XDG_RUNTIME_DIR not set in the environment.
But that's about it.

A bit of Googling and I've found someone who seems to have the exact same lightdm problem: ... 16616.html

No solution there though other than report it to the OS maintainers.

Posts: 15
Joined: Mon Oct 10, 2022 7:05 am

Re: Why is this login prompt randomly appearing?

Fri Jan 06, 2023 5:44 pm

On further investigation there was nothing of note in ~/.xsession-errors or /var/log/Xorg.0.log at present, but when the issue occurs again I will attempt to check them.

Slight tangent, but whilst I'm still trying to shed some further light on this, if I was to set up a quick, bare bones way of restarting the system (and logging it) in the event of lightdm exiting, what might it look like? I've used watchdog previously but never monitored for a specific system-initiated service crashing.

Posts: 15
Joined: Mon Oct 10, 2022 7:05 am

Re: Why is this login prompt randomly appearing?

Thu Feb 09, 2023 9:30 am

The issue happened again a while ago. On checking Xorg.0.log.old I noticed:

Code: Select all

[  1220.413] (EE) 
[  1220.414] (EE) Backtrace:
[  1220.417] (EE) 
[  1220.417] (EE) 
Fatal server error:
[  1220.417] (EE) Caught signal 6 (Aborted). Server aborting
[  1220.417] (EE) 
[  1220.417] (EE) 
Please consult the The X.Org Foundation support 
 for help. 
[  1220.418] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  1220.418] (EE) 
[  1220.419] (II) AIGLX: Suspending AIGLX clients for VT switch
[  1220.513] (EE) Server terminated with error (1). Closing log file.
I notice the setup manual for the display I'm using does have me modifying the X.Org config:

I wonder if that could be a factor.

Posts: 142
Joined: Sat Aug 20, 2022 10:37 pm

Re: Why is this login prompt randomly appearing?

Thu Feb 09, 2023 12:29 pm

Well, at least now we (sort of) know what the problem is. The X server is (unexpectedly) crashing and restarting. This eliminates a lot of the "user error" and/or "translation error" type explanations.

Signal 6 is SIGABRT - which is almost always caused by an assertion failure in the C code. Do "man assert" to read more about this.

Return to “Troubleshooting”