Closed firasuke closed 4 years ago
Many questions in one issue here. I'll try to answer them as broadly as possible.
/run/
today is either a separate ramdisk set up in /etc/fstab
or a symlink to /var/run
, depending on your distro. The FHS details more, in myLinux system/skeleton
there's a base skeleton example.Finit does not use udev, it only starts it at boot, if it can find it and it's relevant directories exist. (Them being missing is probably the reason for you first message.)
Finit comes with a built-in getty, use the examples in the docs to get it running, it calls /bin/login
for each username that it's fed. When you have that running, getting agetty to run should be easier. (I've never tried that myself)
The initctl log SVC
command is a wrapper for grepping for SVC in /var/log/syslog
, it makes tons of assumptions about your system. Sorry for that.
Thank you for taking the time to answer and for your efforts.
I apologize for not providing enough information. I'm working on a linux distribution myself (based on musl libc and toybox), and I'm looking for a lightweight modern init/service supervision suite to use.
So far, I've tested s6 and thought it was the only viable option, but it was until recently that I discovered finit, and I'm liking how simple it is to set it up, without having to worry about bootstrapping or rc.init or any of that.
Regarding this particular issue, it seems that agetty (from util-linux
) just won't spawn the login program (which is /bin/login
), even if I passed -l /bin/login
; It will only work if I used the fallback shell and manually called login
as shown below:
I've read the documentation, and several other examples/implementations of finit.conf
and tried different things to get agetty to work and display a login prompt including (not using all of them at once):
tty [12345] /dev/tty1
tty [12345] agetty tty1
tty [12345] /usr/bin/agetty 38400 /dev/tty1 linux
tty [12345] /usr/bin/agetty -l /usr/bin/login 38400 /dev/tty1 linux
I've also looked at the build.sh
and install.sh
for both of Alpine and Void, but I still can't seem to figure out why the login program just won't load.
I also have a couple more questions:
1- What's the difference between the fallback shell and the emergency shell? Do I need both of them enabled for debugging purposes? I enabled the emergency shell alone and I wasn't prompted with /bin/sh
(which is what the fallback shell would've done), and when I enabled both, the behaviour was similar to having fallback enabled alone.
2- Is finit known to work with musl?
3- Is the output shown when passing debug
to the kernel cmdline stored as a file anywhere (the one shown in the image below)?
4- Are you aware of the existence of the following project libudev-zero?
5- Would it be possible for you to add support for smdev
, or would you say that support for mdev
would suffice?
6- Is cgroups
support a must for finit to work? What if I had cgroups
support disabled in the kernel, will finit still work?
Thanks again!
Ok, I managed to get this to work.
I noticed after passing debug
that the somewhat uncluttered output (thanks to disabling eudev
temporarily), showed that finit
was attempting to read stuff in /usr/etc
instead of /etc
(so my finit.conf
wasn't being read at all). Apparently passing --prefix=/usr
(which is common for many distributions), would cause etc
and var
to be in /usr/etc
and /usr/var
instead of /etc
and /var
.
I actually checked the build.sh
files for Alpine
and Void
and it seems that no --prefix
is being used, which explains why there were no such problems.
I ended up configuring finit
as follows:
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--localstatedir=/var
and using the following /etc/finit.conf
:
runlevel 2
tty [12345] agetty 38400 tty1 linux
I don't plan on using /sbin
and /usr/sbin
, will that cause a problem? Are there any hardcoded paths that require sbin
?
I don't plan on using
/sbin
and/usr/sbin
, will that cause a problem? Are there any hardcoded paths that requiresbin
?
From my last go at this from about a year ago, only /sbin/reboot is hardcoded.
@winkmichael thanks for your response.
I wonder if using --sbindir=/usr/bin
would remove the need to patch it (or maybe there's no evading patching it since it's hardcoded)...
https://github.com/troglobit/finit/search?q=sbindir&unscoped_q=sbindir If you search for the parameter it looks like it only applies to the building and install
Interesting project, hope you get it all going! I'll see what I can do about responding to your questions:
tty
is configured. The rescue mode is a special finit.conf (that you can modify for your system), which kicks in if you add rescue
to the cmdlineRegarding the other questions, that @winkmichael helped answer, the configure script has lots of standard levers for controlling paths. Some of which are not (yet) propagated to paths encoded in Finit binaries, that is still on the TODO list and something others are more than welcome to help out with. Hard-coding /sbin
is of course not ideal, but I've tried to set up sane defaults based on the FHS, so if you stray from that you're bound to run into problems, unfortunately. (Not just with finit :)
Thanks for your time and effort, and for your clear answers.
Regarding this issue, maybe adding a small notice in the documentation for building finit to remind the user to double check his final installation paths if he/she decides to use --prefix
(which is a pretty common flag that's used in many packages, especially ones that have GNU-like configure scripts) particularly sysconfdir and localstatedir, as they'll become nested under prefix (which will be set to /usr in most cases) and will cause mostly undesirable paths (/usr/etc and /usr/var).
I'm closing this issue as it appears to be solved, thanks again.
Good point, will do. Thanks and good luck!
I can't seem to get finit to work. It just hangs at "Requesting subsystem events" and regardless of what I put in
/etc/finit.conf
agetty just won't spawn/bin/login
, and when I adddebug
to the kernel cmdline I get messages regarding/run/udev/queue
Not being found or no such file or directory (I'm usingeudev
btw).I've enabled the fallback shell, and was able to run the login program manually since agetty doesn't want to spawn
/bin/login
(even when using -l), and enter to my system with the shell I have inside it.I'm unsure what to do now and how to debug it. I ran
initctl log
and was told that/var/log/syslog
doesn't exist, so I created it, and the output is empty, any ideas?