Skip to content
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

Improved system management on BSD #15

Open
netbsduser opened this issue May 27, 2021 · 2 comments
Open

Improved system management on BSD #15

netbsduser opened this issue May 27, 2021 · 2 comments
Projects

Comments

@netbsduser
Copy link
Member

InitWare currently boots as system manager on NetBSD by taking over from /etc/rc which is run by unmodified NetBSD init - that skeletal /etc/rc runs some of the early boot-up scripts before the remainder are converted by a generator invoking rcng2unit.

I am now looking to get a FreeBSD system booting with InitWare and want to eliminate some of the fragility of the current approach on NetBSD by instead using a portable program in place of BSD init.

@netbsduser netbsduser changed the title Portable early init program Improved system management on BSD May 27, 2021
@netbsduser
Copy link
Member Author

The approach I mean to take is to create a new portable init(8) (possibly borrowing from the NetBSD implementation.) It is, after all, a small and simple program. System initialisation on FreeBSD and NetBSD will then proceed thus:

  1. Portable init from InitWare sets up its environment, runs /etc/rc.InitWare (a script mainly just to mount essential filesystems) - maybe worth making a custom interpreter for that script a la Android init.rc?
  2. Portable init launches the InitWare manager.
  3. InitWare manager does system startup as normal. (We will from now on use a generator to create unitfiles for all rcNG scripts, and lazily start them by dependency.)
  4. On the InitWare manager exitting cleanly, portable init runs some kind of shutdown script and takes an appropriate action. The InitWare manager could maybe write a byte to portable init to let it know whether to reboot, halt, power off, etc.

@netbsduser netbsduser added this to To do in BSD Port May 27, 2021
@netbsduser
Copy link
Member Author

I just sort-of booted FreeBSD with InitWare using a scheme similar to the above, only I used the usual FreeBSD init (I simply exec InitWare manager daemon from within FreeBSD init; getty services were prepared from /etc/ttys) but the result was a system with non-functional networking and other problems.

I suspect the problem could be that InitWare is fast and parallel, and so breaks assumptions of rcNG scripts which improperly rely on serialised startup with delay between items. So creating unit-files to replace at least the base rcNG scripts seems necessary.

Hopefully the rcNG scripts from Ports and pkgsrc will be less problematic and we can continue to use a generator for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant