OpenRC on FreeBSD

D. Ebdrup debdrup at gmail.com
Wed Dec 19 16:26:15 UTC 2018


On 12/19/18, Martin Wilke <miwi at freebsd.org> wrote:
> Hi
>
> I'd like to reopen the discussion for OpenRC on FreeBSD. Basically this is
> the second attempt to get it into FreeBSD.
>
> I've opened a review here with a working patch for CURRENT,
> https://reviews.freebsd.org/D18578
>
>
> To recap the discussion
>     * First attempt of RFC in March of 2018:
> https://lists.freebsd.org/pipermail/freebsd-hackers/2018-March/052358.html
>     * Working group at BSDCan:
> https://wiki.freebsd.org/DevSummit/201806/OpenRC
>
> Here some key points:
>
> OpenRC provides additional features for service management without requiring
> kernel changes or replacing pid 1, unlike launchd and other solutions.  All
> rc.d scripts have been converted with a few changes, typically changing the
> shebang and making sure the start function is named start(). Most service
> scripts are simplified, usually needing only name, command, and, if
> required, depends statements.
>
> History:
> OpenRC started out as an init system by Roy Marples, developed for the
> Gentoo Alt (FreeBSD) kernel branch. It was more widely adopted into Gentoo
> as baselayout v2, and was then split off as a separate BSD-licensed project.
> It is under active development, portable, and remains BSD licensed today.
>
> OpenRC and RC:
> Both can coexist and be chosen with a setting in /boot/loader.conf.
>
> OpenRC Features:
>
> Service supervision and service monitoring: any service can be supervised.
> Supervised services that crash are automatically restarted. The rc-status
> command shows how many times a service has restarted.
>
> Device hotplug support and event-driven service management: the hotplug
> feature allows devd to take actions when devices are connected. For example,
> a USB wifi adapter can create additional network services when attached. The
> net-online service can, for example, detect when a network connection is
> restored, and restart ntp.
>
> Network profiles: using stacked runlevels, different profiles can be
> established for different networking settings. For instance, different
> profiles can be used for wired or wireless networking, or for differing
> wireless networks, as well as dependency caching and parallel startup speed
> up booting.
>
> Interactive mode:
> The boot process can be run interactively for more effective debugging.
>
> OpenRC uses the term “runlevels” to refer to the context in which a script
> is running. There are only three at present:
> sysinit (the OpenRC system is starting), boot (start base services when the
> computer is booting), and default (normal execution).
>
> OpenRC, by default, provides a “colorized” text boot, using ANSI color
> sequences. This can be disabled.
>
> Ports:
> As of July 2017, iXsystems has created OpenRC versions of port service
> scripts for the entire ports tree. These scripts coexist with the rc.d
> versions.
>
> License:
> OpenRC is a BSD licensed RC init system written in C. From a user
> perspective, it is very similar to the FreeBSD rc.d init system, making it
> easy to use and learn.
>
> Tested: OpenRC has been used as the init system for TrueOS since October
> 2016.
>
> Ken Moore has an OpenRC vs RC.d comparison which can be found here:
> http://www.wonkity.com/~wblock/openrc/OpenRC_rc.d.pdf
> <http://www.wonkity.com/~wblock/openrc/OpenRC_rc.d.pdf>
> I look forward to discuss the features and capabilities of OpenRC.
>
> Regards,
> Martin
>
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>

You mention parallel service startup as an advantage of OpenRC, but to
the best of my knowledge it is turned off by default everywhere, and
there's no actual guarentee that parallel service startup won't
randomly break.

Indeed, there are two outstanding bugs for this very issue, [1] has
been open/connfirmed since 2011 and [2] has been open/with nobody
assigned since 2014 - neither of them seem to be fixed, from what I
can tell?

It seems to me that if this is indeed a feature that people want (and
I can see why, if you're starting a few hundred jails with only few
inter-dependencies) - but I feel sure that people won't want it if it
means that the system will no longer boot reliably.

So what I'm really asking for, rather than not enabling parallel
startup by default (despite this being what most projects apppear to
have done), can the problem be fixed before OpenRC is in FreeBSD, such
that FreeBSD can have parallel startup that reliably works?

I wish I had the talent to contribute in any meaningful way, but I'm
just a sysadmin and as a coder I'm a pretty poor florist.

[1]: https://bugs.gentoo.org/391945
[2]: https://github.com/OpenRC/openrc/pull/12
-- 
Daniel Ebdrup aka. D. Ebdrup.


More information about the freebsd-hackers mailing list