# OpenRC with FreeBSD?



## u666sa (Sep 17, 2022)

What's the status of OpenRC on FreeBSD?


----------



## _martin (Sep 22, 2022)

Best you can find is this OpenRC for FreeBSD.


----------



## Alain De Vos (Sep 22, 2022)

I would like to post a question. What is the main advantage of openrc above the current freebsd-rc ?


----------



## mer (Sep 22, 2022)

Is there an offical project to replace the current init system with OpenRC?
One of the iterations of "TrueOS" went and did this, but it turns out a lot of changes.
Every single rc script needs to be changed.  /etc/rc.d, /usr/local/etc/rc.d, even some of the ones in /etc.

So every single port that has an init script needs to be changed.

The format is similar to freebsd-rc but enough difference that you can't just "awk sed fred" files which makes
maintaining it non trivial.

Now to try an answer some of Alain De Vos questions, my understanding:
shorter startup time, OpenRC in theory starts things more in parallel.
some say "more intuitive files, easier to understand" 

My opinion:
It worked, pretty well, but some things I don't care about it because I'm not always rebooting a system.
But a lot of work to switch to it, every single port that has an init script would need to be patched, especially if the upstream source did not already use OpenRC.
So will we ever see it on FreeBSD proper?  Probably not, if we do, it will be a stepping stone to bringing in systemd.


----------



## Alain De Vos (Sep 22, 2022)

fyi,





						Init system - Gentoo Wiki
					






					wiki.gentoo.org


----------



## mer (Sep 22, 2022)

Yep that is a good resource


----------



## Alain De Vos (Sep 22, 2022)

Fyi boot flame-sharts , but I was unable to make flame-sharts,


			BootTime - FreeBSD Wiki


----------



## ayleid96 (Sep 22, 2022)

mer said:


> it will be a stepping stone to bringing in systemd.


Why?


----------



## Alain De Vos (Sep 22, 2022)

OpenRC is not that different from FreeBSD-rc.
But for it all scripts have to be rewritten. Who will do it?
And will it significantly decrease the boot-times ?
[For one , my Gentoo install with openrc boots very fast ]


----------



## mer (Sep 22, 2022)

ayleid96 said:


> Why?


Sorry, I forgot to add the "sarcasm" tags to that line.
It was an attempt at a joke, obviously I missed the mark.

So let me make it clear:
OpenRC on FreeBSD is not a stepping stone to systemd on FreeBSD, but in my opinion will not replace the current freebsd-rc system.
The current freebsd-rc system may evolve from where it is now, but I don't see it migrating to systemd.

My opinion follows.  May wind up with too many words, I apologize in advance.


Alain De Vos said:


> But for it all scripts have to be rewritten. Who will do it?
> And will it significantly decrease the boot-times ?


That is exactly what I was saying back up in post #4.  It is not just the base system it is every single port that has an init script.  How many ports is that?  It adds to the complexity of maintaining a port.
Yes an OpenRC script is very similar to current init scripts but not really close enough to do an awk sed dance to convert.  Perhaps I'm not skilled enough to do it, but it is relatively easy to look at an existing freebsd-rc script and create an OpenRC one from scratch.
Will it significantly decrease the boot times?  I think it depends on the specific installation.  If it does for you it may not for me.  The page you linked earlier up in #7:  13.0 was roughly 25 secs, the linux distros were 10s and 1.2 secs to the same point.
I recognize that when you are rebooting the backup server for a mission critical database 25 secs is "forever", but my systems have uptimes in 100's of days, so 25 secs out of 1 day (86500 secs) becomes noise.
Again, I recognize everyone has different needs on this.

I prefer correctly booting every single time over a faster boot.

I'd also like to point out that all these init systems  depend on people to code the dependencies in the script correctly.  Make sure you are waiting for the right things like network up, disk available, etc.  Get that wrong and you have a system that boots very fast to a broken state.

Do I think OpenRC is a good init system?  Based on my experience with it, Yes.
Do I think OpenRC will replace current freebsd-rc init system?  No or at least not in the near future.


----------



## recluce (Sep 22, 2022)

--- removed in order to discourage more patronizing posts like the one below ---


----------



## _martin (Sep 22, 2022)

Btw. OP had a question about the status of the OpenRC on FreeBSD not about what others like or feel about it.


----------



## mer (Sep 23, 2022)

_martin said:


> Btw. OP had a question about the status of the OpenRC on FreeBSD not about what others like or feel about it.


Fair enough.  I tried to do both, simply because to the best of my knowledge there is no OpenRC on FreeBSD so the status is "not available".  There have been a couple of distributions based on FreeBSD that used OpenRC, but at the moment I don't think they exist anymore.


----------



## Alain De Vos (Sep 23, 2022)

Note : The file "/etc/rc.subr" is interesting for FreeBSD


----------

