-
Notifications
You must be signed in to change notification settings - Fork 14
Allow empty default_cmd in brn.conf #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
If default_cmd is unset, then the init configured in strata.conf will be used.
|
This will fail if a user has multiple init options set, which is what Some distros provide multiple init options with different paths such that they can all be installed at the same time. For example, on Debian, you can install runit which installs /sbin/runit-init so you can have that and systemd's /lib/systemd/systemd installed at the same time. On my system, I have: That's why If |
|
How about only pick up the init in strata.conf as default_cmd only if there's one init configured? When there's multiple init configured then the selection menu can ask user which to use. What I don't like is having to configure the same thing in two different places. User might forget to chang 'default_cmd' after changing the 'init' in strata.conf. |
That's what I had proposed in the last paragraph of my previous entry here. My concerns there:
In contrast to the issues with the current system:
From my point of view, the problems with the proposed system are both more significant than those with the current one, as well as more likely to happen. I've never heard of anyone forgetting to change the config specifying the default init when they want to change the default init. Has that happened to you, or someone else you know? It could be I'm just in an echo chamber of more experienced users here and missing something. I've also never heard of anyone removing an undesired init from a desired stratum - usually either the stratum goes, or both inits are retained. Are there any other routes we could take here that alleviate all above-mentioned concerns? It could be there's something neither of us have yet considered that would work well for both of us.
I'll bring this up at today's dev meeting in the IRC room, see what other people say. You're certainly welcome to attend, although I fear the time may be problematic for you. It's in our IRC room, #bedrock on freenode, at noon EST on the last Sunday of every month.
I agree. This is a problem for other config values, like However, the default init items are two different values. In one instance we list available init options, and in another we pick a default. I don't see the latter as redundant. |
I didn't see why the solution I proposed will have this problem: When user add another init, the worst thing that can happen is that brn will go from booting directly to asking user to choose an init.
But the user will see the init configured in strata.conf Well the best the solution I can think of is like this: In strata.conf: Then in brn.conf |
Avoid quadratic time complexity by incrementally copy path components
Ground work for vfork()+chroot() brp_realpath() Also removes access() check in read_filter, because brp_realpath() should have already made sure the file exists by using lstat()
Also, brp_realpath is replaced by brp_openplus brp_realpath returns a path, which in most case is not what the caller wanted. Causing them to repeat brp_realpath's work (e.g. lstat()). The new function returns a file descriptor and stat instead.
Prepare for chroot()
Now instead of resolving symlink relative to stratum root manually, we first chroot() into the stratum root, then let the kernel do the path resolution.
Reduce the number of seteuid() calls, which is quite heavy
That "worst thing that can happen" is the unpleasant surprise that I'm talking about. All of a sudden the machine stops booting. Consider the (very common) workflow where people do not typically have physical access to a machine, but instead remote into it via
Yes, there will be a line which mentions it there. However, the fact that that line is also interpreted to mean it should be the default is implicit / non-obvious.
I don't see how this helps your goal here - you still have to touch two files |
|
I've got an idea that I believe will resolve your original issue with what may be acceptable downsides. Consider: The We could have a
Something like this: We could also have a |
|
OK. |
|
With the upcoming release, the configuration system has been completely reworked with the aim of resolving a number of independent issues the previous system had. I did remember there was a push to remove redundant configuration (although I forgot where it came from and failed to comment about it here) and I did incorporate it into the design. It's somewhat close to what I had described above: the meta-init system automatically detects likely inits so the user does not have to explicitly configure them per stratum. We'll likely be able to collect a list of common init system file locations and effectively remove the need for users to do any manual configuration there. The only thing the user will need to configure is their preference for the default and the timeout. Here is the relevant bit of a proposed config for the upcoming release. Provided you're in agreement that resolves the concerns, we can close this. Otherwise, let me know and we can adjust. The code to consume this configuration is still very much in flux and now is a good time to make such changes. |
Here's a non-exhaustive list of standalone ones:
For the ones with integrated management check this list; out of these OpenRC and systemd are common. |
|
@Mouvedia Apologies for not being clear; I assumed prior experience with what Nyla does in this domain. What I need is the file path to the init's initially launched executable. With most inits as packaged by most distros, this is From Bedrock's point of view, it doesn't really matter which init system has its initial executable at a given path, it just needs to know which paths to look at which might provide an init option it should offer to the user. Bedrock doesn't care if Here's a list of what I know of so far:
You're welcome to dig into rarer inits and figure out what Bedrock should expect for them if you'd like. However, it's not a big priority. I expect the above list will hit the vast, vast majority of user use cases, and the exceptions will likely be able to configure Bedrock accordingly (and will hopefully report it so we can support that going forward). We don't need an all encompassing solution here for Poki, just one good enough for the immediate future. |
|
|
Added them - thanks! |
If default_cmd is unset, then the init configured in strata.conf should be
used.