summrum / void_dinit

Files for using dinit as system init on Void
The Unlicense
12 stars 0 forks source link

Not booting. #2

Closed Alleop5 closed 1 year ago

Alleop5 commented 1 year ago

This maybe belongs to the dinit issues but this seems like a Void Linux issue so I'm guessing you'll know it.

First of all when I run it in my normal terminal it'll cry about emergency_shell not being found. That's not important because that failed because it couldn't mount on / (Which was ofcourse in use because I'm using the drive) Here's the log but shortened to the errors because idk how to get logs from my vm to my main. dinit: In multiple cgroups, cannot determine cgroup root path dinit: dbus-setup: execution failed - setting up standard input/output descriptors: No such file or directory dinit: rclocal: execution failed setting up standard input/output descriptors: No such file or directory Also STOPDD idk what that means but a ton of them say that. Also there's 2 tty1's one that says OK and the other STOPPD

If you need more info I'll be glad to give it to you! I just want this to work and this https://www.reddit.com/r/voidlinux/comments/11ofqt2/booting_with_dinit/ is the reddit post where I got recommended here. If you read that you'll see that I already tried to install it manually and it was basically the same but without any services crashing because I didn't have any. That also produced the same result I currently have. If you want to just see everything in a screenshare or something like that here's my discord: Alleop#4152

summrum commented 1 year ago

I'll try to help as best I can, but have not tested on a VM yet. It's something I aim to do when I have a bit more time. Just to check, are you using all or some of the scripts from this repository? Please could you list the contents of /etc/dinit.d/boot.d and let me know of any differences/changes to service files and scripts I've placed here? Also, how are you building dinit?

For a more minimal setup, if using the scripts from this repository, the symlinks in /etc/dinit.d/boot.dcan all be deleted. This should keep the logs a bit clearer and stop us trying to launch services like NetworkManager (and consequently dbus!). I should perhaps just remove all those symlinks by default from this repository anyway.

I guess there is (at the very least) an issue with filesystem setup. If you were able to provide any more output that would be great. I'm a bit confused as to exactly what you mean by not booting - are you booting, but getting the errors you mention and not able to get to a usable console, or can you enter any commands?

Alleop5 commented 1 year ago

I'm using all the scripts of yours but I have tried doing only building dinit but I didn't have any of your services back then. Now I completely use all your things. Because I believe you have way more knowledge about this than me. (I was too lazy to inspect all the scripts from artix) I've got your default stuff in /etc/dinit.d/boot.d I know that isn't required since only boot is required ofcourse. I've run that command when I still had the full service folder so I'll output the errors without the boot.d folder now. And it still has the same things fail. rclocal is a dependency of boot and idk what has a dependency of dbus but it's probably a dependency of some other dependency in boot but I'm a little too lazy to check 20 files. More output would be great. Then I could fix it. But first it's blinking underscore from the terminal and then it goes blank (I think it is when dinit loads). So no output. Only 2 errors. Could you explain what stoppd means? Still don't understand it.

summrum commented 1 year ago

Yeah, it's the /etc/dinit.d/boot.d/network service which is calling NetworkManager, which in turn is calling dbus. I think that should be disabled until we can figure out the issue here. The rclocal service just attempts to execute /etc/rc.local (and /etc/rc.shutdownon stop), so it is telling us that /etc/rc.localcannot be executed. My guess is the issue is somewhere with the early-filesystems, or possibly with filesystems or rcboot. [OK] shows dinit launched the service with no issues, [STOPPD] shows that they have stopped due to an issue.

Are you using the most recent versions of the scripts here? I updated some of the early services a few days back to have the shares-console option, which should direct output to the console during boot. This might help give some more detail.

Alleop5 commented 1 year ago

How to enable shares-console? image Doesn't show network if I'm not blind. So your probably wrong. Also I don't have dbus or NetworkManager installed. When I install dbus it doesn't do anything. Also rclocal calls loginready which has the waits-for = dbusd. That's where it comes from and not network. Though dbusd should stand for dbus daemon right? I've tried disabling it now. Also just realized because rclocal failed boot failed which is probably why it fails. I've now tried removing the dependency for rclocal because that doesn't seem important tho that has the dependency for loginready which is maybe important. image In this virtual machine the username is void and the password is voidf but ehh. That doesn't seem right. But atleast it's 1 step further. Wait what? I've done it a few times wrong and then it'll relaunch the login prompt. Which is normal under void. And then it magically logged in? I'll test this on a reboot. WAIT WHAT? It now immediatly asks for a password. image For a non-existing user. Also the hostname disappeared. BUT IT WORKS! When I enter the password wrong it'll ask for a username and password. image Magic? You should probably know a little bit more so I'll leave this message here. image ^ htop shows it as if it's dinit which means it isn't using runit anymore! But the weird first asking for a password should be solved before I'll put this magic on a real computer.

Alleop5 commented 1 year ago

Just checked how the hostname was set. It's via /etc/hostname and runit by default choses void-live if it doesn't have a hostname I think. That isn't a problem that's just the way I installed void.

summrum commented 1 year ago

Not sure about your user/password issue, seems odd.

If you have the /etc/dinit.d/boot.d/network symlink from this repository, this will enable the network service. The network service depends on NetworkManager, which in turn depends on dbus; this is what is launching dbus if you have the services and symlinks exactly from this repository. My recommendation is to delete the /etc/dinit.d/boot.d/network symlink to disable this service (can delete all from boot.d if you wish to reduce down further). I will remove this from the repository here as well, as I think it is a bit much to include by default. Waits-for is not a hard dependency (but will enable the service as you say), but this should probably be after instead of waits-for(which was added after I initially wrote many of these services, and I neglected to check and update them).

In the service files they can have options = shares-console, which will print the output from the service to the console. This is very useful for early services, particularly before filesystems and console access are up.

Alleop5 commented 1 year ago

I've already removed all the boot.d symlinks like you said. Also like I said you've made rclocal kinda start up dbus if I'm right. Also every problem is resolved that I asked for except the user/password issue. Which you know solves the title but isn't ideal still. Which service starts the login screen? Also is there any way to just skip the login screen straight up into a user? I'm thinking of encryption but putting in 2 passwords could be tiring.

summrum commented 1 year ago

rclocal depends on loginready; it is loginready that had waits-for dbus which I have now changed to the more appropriate, newer, after in commit 7976ea8. With this change, loginready should not be starting dbus (nor will anything that depends on loginready). I think that should be everything starting dbus by default, but I do need to go through and have a thorough check.

I don't really know what is happening with your user/password issue. The boot service has depends-mson tty1-6. It is when TTY1 is started that you should be able to login. You could just enable tty1 service to see if that helps (i.e. disable the others). The loginready service is just more of a milestone service.

It is possible to have a particular TTY (e.g. TTY1, by editing tty1 service file) automatically login a user with something like the following:

command = /sbin/agetty --skip-login --login-options USERNAME --noclear tty1 38400 linux

This will just ask for a password for the specified USERNAME. There is also the -a (or --autologin) option for agetty which will login the specified user without asking for the username or password (see man agettyfor all the options and also note the --login-options parameter). Hope that helps.

Alleop5 commented 1 year ago

Aha issue solved! Removed the --skip login in the tty file. While I was typing this you made your comment so I see --login-options is used to auto-login and you have that by default in this repo to your user (Which I really hope is not your real name but it seems like it is). You should change that. Also thank you for all your help! Had lost a little hope since my last issue. Which was in the Hyprland repo which is really toxic.

summrum commented 1 year ago

Fixed!

Alleop5 commented 1 year ago

Also /sbin is linked to /bin so that could save a few bytes iirc but that isn't really that important. I'll do some more testing to see if all your services are absolutely required but I'm already pretty sure auxfilesystems isn't required because runit also doesn't do that but I'll first do some testing on real hardware.

summrum commented 1 year ago

There are a few /sbin references in the files, I never bothered to tidy them up (but perhaps should for neatness). I think /usr/bin is the path to use on Void, not /bin.

The auxfilesystems service does what the Void runit core service 03-filesystems.sh does at the very end (so this command is run during startup on a normal Void runit setup). I could perhaps combine it with the filesystems service to make it more similar to Void, rather than separating the two.

Alleop5 commented 1 year ago

How is /usr/bin different from /bin? Also could you make a seatd service file or provide a tutorial to make your own? Because I'm stuck on real hardware at that part. Using dwl but it requires seatd. If I use sudo seatd -g _seatd it works but when I put it in a service it wont.

summrum commented 1 year ago

/bin, like /sbin, is a symlink to /usr/bin on Void so I guess the true path to use in the service files and scripts is /usr/bin. I haven't tried seatd, can have a look at a service for it.

summrum commented 1 year ago

I would write an initial service template to test something like this (based on the Void runit service run file):

type = process
command = /usr/bin/seatd -g _seatd
smooth-recovery = true
waits-for = loginready

It may require use of the ready-notification option as well, if dependent services are being started too quickly before it is truly running correctly (e.g. the dbusd service uses ready-notification = pipefd:3 option, so you could choose another number if necessary).