rcd(8) - new service manager daemon

The difference is that CPAN went down (as in they turned OFF CPAN) and then you literally could not use entire perl scripts because you had no way of getting the dependent perl modules that were dependent in those scripts. Not to mention that in (NON-INTERNET) connected environments there was no way to get all of the various perl script depend modules - because you needed access to CPAN.

You honestly can't say that about sh(1) right?
You can do a lot with Perl Core without any Internet connection. If you need more there is p5-xxx packages.
 
The parallel boot will be coming "for free".

The increasing complexity and variety of user's boot scenarios will require drawing a proper dependency graph. Once you have one that works it is trivial to do it in parallel.

WRT boot messages - I'd like to keep them. Just sync the printing.
 
sh(1) doesn't change much either.
There are good reasons why you don't want to use shell scripting for this. See: https://skarnet.org/software/execline/dieshdiedie.html

In the s6 suite of tools this issue was solved with execline. If you have something legacy you don't want to re-write using shell scripts (or whatever else) you can simply pass it straight through using execline scripting. The way systemd "solved" the "hacky shell scripting" problem was using unit files which are even worse than shell scripts since it's hard to express complex logic since they aren't a real scripting language and instead are more akin to .ini files.

Lua and perl don't really matter but both are more general purpose languages that pull in their own stuff to make them work so now you have yet another thing in base that can go wrong. By comparison execline is smaller and more suited for this task. But given the choice between perl and lua the decision to use lua is probably the better choice. Other things I'm already using want lua so I personally need it anyway.

Perl is not bad despite its reputation and everyone deciding they suddenly hated it sometime around 1999-2000. There is a good reason why it exists and why people heavily used it over writing shell scripts. It's more portable and less prone to failing spectacularly. It's also good job security if you're the type of person into writing complex one-liners with it.

Perl and lua are certainly much better to have in the base system than something like python. Python is a glutton and it likes to break things every time a new version comes out. God help you if you want to use libraries.

A supervision suite is not bad thing in fact it solves a lot of problems within a UNIX-like OS's user space. But it brings a lot of complexity of its own and there are hard problems you have to solve if you're going to commit to having it. For example, how will daemons communicate? Now you need a standard way to do IPC that can not fail. You need to re-think how logging works especially if you're going to do complex starting/restarting of services at the same time. You have to make sure logs are ordered correctly and the logging mechanism is bullet proof so it won't ever crash and lose logs. You have to manage a complex web of dependencies. You now have to maintain and build some kind of database to ensure things start in the correct order and it quickly gets complex when you have things that require other things to already be running. You have to ensure the state is the same each time your complex tree of dependencies and daemons are started (one reason why using shell scripts is a bad idea). Most of these problems either require designing the service management with a lot of forethought or forcing new ways of doing things into the rest of the system.

Most popular supervision suites have been designed very badly hence why we're now in a situation where Linux boxes require rebooting when things in userspace are updated and the PID1 is now so large. Even the things that inspired systemd like launchd have a whole host of problems (e.g. use of XML). So people are right to be paranoid when they see such complexity being adopted by other OSs. The past has shown it's very hard to get this stuff right.

The faster boot times is a myth in my experience. At least in the Linux world. systemd is not only much harder to debug it's much slower at start up on every system I've used it on compared to things like runit, OpenRC, sysvinit and all of the others. As I said before "parrell start up" is mostly not real. Since you have to wait on daemons to "settle" anyway before they can actually communicate with each other and go on to do real work. Servers and laptops are rarely rebooted as much as people like to pretend anyway. A laptop is typically suspended to RAM/disk or the majority of the boot time is spent everywhere that isn't init/service manager firing up daemons at boot. Desktops and servers are typically running 24/7 and the few seconds at boot do not matter anyway. If your system is being rebooted all of the time you have other problems you should address. Similarly, auto restarting some daemon that's constantly crashing or otherwise acting up is not the proper way to address that problem. You should instead reconfigure/debug it or use something else. If it's that misbehaved then having some complex service manager restarting it multiple times an hour is just kicking the can down the road.

A lot of the supposed "benefits" provided by something like systemd is just marketing and bad engineering.
 
At least in the Linux world. systemd is not only much harder to debug it's much slower at start up on every system I've used it on compared to things like runit, OpenRC, sysvinit and all of the others.
No disagreement here. One of my biggest "wtf did you do this" with systemd is journald. If you've ever had a failed boot you get a string of digits, no text. Then you discover the logging is through journald but it's binary. So one can't cat | grep | awk like you can do with dmesg and syslog. The few times I've had this happen I luckily had another system that I could "hey duck duck go wtf does this systemd error message mean".

A lot of the supposed "benefits" provided by something like systemd is just marketing and bad engineering.
Ha. Thanks for making an old man LOL.

One thing I see with things like Solaris SMF/rcd is the management of things started. "Do I daemonize this thing or not" Current startup stuff (generically rc stuff) a lot of the responsibility is in the specific service script itself.
Normally that works fine, but corner cases make it fall apart.
So something that does a better job of managing things, in a consistent manner, should not be considered a bad thing. My understanding of Solaris/SMF is that consistent management is a big plus.

FreeBSD:
Base vs ports. Trivial (not easy) to change from one rc system to another.
Ports/Packages. Not at all trivial, not at all easy to change. Typically carry at least 2 sets of patches on service files, based on version, which leads to maintainers having to understand a bunch more. At some point one can assume convergence, but FreeBSD will still carry patches for a while. Chances of pushing specific patches back upstream are "You can ask but we don't need to pull"

I don't know what the right thing is anymore. I've lived through probably 3 or 5 different init systems between *BSD and *niux system, and imagine at least 10 more before I stop being able to type out rants.
 
this is completely irrelevant. if you don't enable it in rc.conf it doesn't matter if you have 3 or 3000 scripts in [/usr/local]/etc/rc.d
Every rc script you have in /etc/rc.d or /usr/local/etc/rc.d is being parsed and executed during startup, no matter if you have foo_enable="YES" in rc.conf or not.

I think you have a lot of misconceptions about how rcNG works and what rcd actually is and where it plugs into the whole system...
Very likely. But I'm trying to project future use of this new rcd startup subsystem, I can foresee lots of new problems added and very few resolved (if any?).
 
One thing I see with things like Solaris SMF/rcd is the management of things started. "Do I daemonize this thing or not" Current startup stuff (generically rc stuff) a lot of the responsibility is in the specific service script itself.
Normally that works fine, but corner cases make it fall apart.
So something that does a better job of managing things, in a consistent manner, should not be considered a bad thing. My understanding of Solaris/SMF is that consistent management is a big plus.
This is the only problem worth solving, but there's no need to introduce UCL or whatever new files for that. From what I can see, rcd already can parse rc scripts, just treat them as first class - parse them, build tree, run sequencially or in parallel, keep and monitor PIDs. This approch is good both for ports maintainers and for users. No changes are visible on user-level.
 
"parallel start up" works like this: We make a new daemon called daemon C. Daemon C comes up first and pretends to be daemon A, B, D, E, F, G etc. It fakes state that makes everything think daemon A is both up and that you can communicate with it. It holds whatever daemon B sends at start up in a queue and tells daemon B everything is a-okay and/or to wait. Once daemon A is really up our new daemon C spams it with all the crap in the queue from daemon B. daemon A can finally really respond to daemon B. daemon A and B go on about their merry way.
Nonsense the directed acyclic graph forbids this.
 
This is the only problem worth solving, but there's no need to introduce UCL or whatever new files for that. From what I can see, rcd already can parse rc scripts, just treat them as first class - parse them, build tree, run sequencially or in parallel, keep and monitor PIDs. This approch is good both for ports maintainers and for users. No changes are visible on user-level.
Working with POSIX shell is hell, do no recommend.
 
Working with POSIX shell is hell, do no recommend.
Shell scripts should best written in POSIX shell for maximum portabilities.
If it doesn't fit you, you'd better choosing different language that fits your needs.

rc.d scripts has shebang line at their top. So you can specify any interpreter there for ports (and any in-base scripting languages like flua even for /etc/rc.d/) if the language is sanely pulled in as RUN_DEPENDS.
The requirement for the language itself is that character # shall be considered as the top of comments in each lines. And need to implement the equivalent of /etc/rc.subr yourself. Not theoretically impossible.
 
Shell scripts should best written in POSIX shell for maximum portabilities.
I part this, because turing complete means things can get very ugly. For the other part POSIX shell is so unclear about what is what, FreeBSD manpages have little to no documentation, at least if not reading everything, which explains what the set flags do.
 
Working with POSIX shell is hell, do no recommend.
man sh says it's mostly POSIX.1 plus some BSD extensions.

Shell can be good or bad, but it is still widely used and there are people (old admins mostly) who understand it. I remember times when training courses on Shell programming were popular. I still keep a couple of OReilly books.
 
I watched the video an looked into the code, Lua is inevitable.



We have Shell and Perl, that's sufficient. Lua is ok for bootloader where resource is scarce, nowhere else.


Again, I read and watched the video, I looked into the code. I think I got he's idea quite well. FreeBSD will have systemd.


I'm quite old to know how this all ends, see my comment above. To add to that, we will have lots of broken ports which will be deprecated and removed becauase noone will want (have time) to fix them.

Clearly you didn't because all of what you said is factually incorrect. There's more clarity in the mailing list thread I referenced.

Also, Perl was removed from base years ago.
 
Back
Top