Skip to main content
Topic: How to stop lightdm from restarting forever (runit) ? (Read 560 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to stop lightdm from restarting forever (runit) ?

First things first. this topic is not connected in any case with lightdm or nvidia (I know how to deal with these). Just some observation and the need to change the runit behavior.

So, I've been fiddling recently with nvidia drivers and stuff and encountered a problem (well, my own problem) with LightDM. It didn't start because I simply forgot to update my Xorg configuration file (leaving nouveau instead of nvidia there). I know it's my fault, no issue here. I know how to handle this.

The problem is:

I cannot change virtual consoles. After pressing Alt+F1 (or any other F) it switches to that console for a second and then instantly back to the faulty F7 with a blinking cursor. I mean I cannot change to another console to simply stop the LightDM service and fix things. The LightDM service just keeps trying to respawn forever blocking me from other virtual consoles.

The need is to tell runit to stop a service after, say, three retries if it meets certain conditions like a successful start, for example. Can it be scripted somehow? Probably a finish script inside lightdm dir or something.

TIA

Re: Race condition in lightdm (XFCE, runit) ?

Reply #1
I guess I should've posted this in the Runit forum section.

Re: Race condition in lightdm (XFCE, runit) ?

Reply #2
The problem is runit which keeps restarting lightdm ad infinitum. Not sure if it's possible to limit its retries though, I've never used runit.

Re: Race condition in lightdm (XFCE, runit) ?

Reply #3
The problem is runit which keeps restarting lightdm ad infinitum. Not sure if it's possible to limit its retries though, I've never used runit.

Thanks, I guess I need to google more and learn how to script it.


Re: How to stop lightdm from restarting forever (runit) ?

Reply #5
Been fiddling recently with nvidia drivers and stuff ...

  :-* 

RTFM:

https://unix.stackexchange.com/questions/735868/tty-disabled-when-using-nvidia-gpu-arch
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: How to stop lightdm from restarting forever (runit) ?

Reply #6
Afaik runit only restarts lightdm if this errors out.
Did you check the log file in /var/log/lightdm?
You can also try to run the lightdm command from the runit service manually to see what happens.

artist

Re: How to stop lightdm from restarting forever (runit) ?

Reply #7
Afaik runit only restarts lightdm if this errors out.
Did you check the log file in /var/log/lightdm?
You can also try to run the lightdm command from the runit service manually to see what happens.

artist

Yeah, the question is how to stop the lightdm service after a certain number of retries because I simply cannot change to another TTY. The culprit here is actually runit.
I want to find anything related to it and how can I alter its behavior. Probably adding some finish script for it, not sure. That's why I've asked to move this topic to Runit forum section. Also, to get rid of such people like lq above with unrelated comments who cannot read the initial topic properly.

Re: How to stop lightdm from restarting forever (runit) ?

Reply #8
Did you check the log file in /var/log/lightdm?

Nothing special. Obvious errors because Xorg and LightDM couldn't start. Notice these "Using VT 7" and "Releasing VT 7" messages stuck in a loop.

You can also try to run the lightdm command from the runit service manually to see what happens.

You simply cannot change to another TTY in order to get to the command line at all.

After pressing Alt+F1 (or any other F) it switches to that console for a second and then instantly back to the faulty F7 with a blinking cursor. I mean I cannot change to another console to simply stop the LightDM service and fix things.

That's the problem.

The runit docs are pretty scarce, at least I couldn't find anything related.

Re: How to stop lightdm from restarting forever (runit) ?

Reply #9
For starters, disable the lightdm service so runit won't auto-start it. Then fire up lightdm from the console as root and see if it spews any errors.

Re: How to stop lightdm from restarting forever (runit) ?

Reply #10
For starters, disable the lightdm service so runit won't auto-start it. Then fire up lightdm from the console as root and see if it spews any errors.

I'm sure it will spew the same as in my logs above. It can happen to any service actually, whether system or custom/local. The need is to tell runit to stop a service after, say, three retries if it meets certain conditions like a successful start, for example. Something should be altered/added to a runit service. Or scripted somehow.

This topic is not connected in any case with lightdm or nvidia (I know how to deal with these).

Please move this topic to Runit section.