Artix Linux Forum

Init systems => runit => Topic started by: TheExplorer on 15 August 2024, 11:52:21

Title: How to stop lightdm from restarting forever (runit) ?
Post by: TheExplorer on 15 August 2024, 11:52:21
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
Title: Re: Race condition in lightdm (XFCE, runit) ?
Post by: TheExplorer on 16 August 2024, 12:22:32
I guess I should've posted this in the Runit forum section.
Title: Re: Race condition in lightdm (XFCE, runit) ?
Post by: nous on 17 August 2024, 14:11:09
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.
Title: Re: Race condition in lightdm (XFCE, runit) ?
Post by: TheExplorer on 17 August 2024, 18:27:59
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.
Title: Re: Race condition in lightdm (XFCE, runit) ?
Post by: TheExplorer on 19 August 2024, 11:58:31

Can you please move the topic to Runit (https://forum.artixlinux.org/index.php/board,30.0.html) forum?
Title: Re: How to stop lightdm from restarting forever (runit) ?
Post by: lq on 19 August 2024, 12:55:45
Been fiddling recently with nvidia drivers and stuff ...

  :-*  (https://www.youtube.com/watch?v=Jc2v_Gs3h2U)

RTFM:

https://unix.stackexchange.com/questions/735868/tty-disabled-when-using-nvidia-gpu-arch
Title: Re: How to stop lightdm from restarting forever (runit) ?
Post by: Artist on 19 August 2024, 13:01:49
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
Title: Re: How to stop lightdm from restarting forever (runit) ?
Post by: TheExplorer on 19 August 2024, 15:24:32
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.
Title: Re: How to stop lightdm from restarting forever (runit) ?
Post by: TheExplorer on 19 August 2024, 15:46:28
Did you check the log file in /var/log/lightdm?

Nothing special. Obvious errors because Xorg (https://pastebin.com/raw/wJUzjZEq) and LightDM (https://pastebin.com/raw/FQpDyWJU) 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.
Title: Re: How to stop lightdm from restarting forever (runit) ?
Post by: nous on 19 August 2024, 16:07:22
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.
Title: Re: How to stop lightdm from restarting forever (runit) ?
Post by: TheExplorer on 19 August 2024, 16:32:49
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.