For faster navigation, this Iframe is preloading the Wikiwand page for OpenRC.

OpenRC

OpenRC
原作者Roy Marples
开发者OpenRC开发者
首次发布2007年4月5日,​17年前​(2007-04-05
当前版本
  • 0.54.2 (2024年6月28日;稳定版本)[1]
编辑维基数据链接
源代码库 编辑维基数据链接
编程语言C[2], Shell
操作系统Linux, FreeBSD, NetBSD, TrueOS
文件大小~900 KB
类型Init守护进程
许可协议2条款BSD许可证
网站www.gentoo.org/proj/en/base/openrc/

类Unix系统上,OpenRC是一个基于依赖的init系统。因为多数发行版切换成了systemd,它被用作一种替代的init系统[4][5][6]。它是Roy Marples创建的,他是也活跃于 Gentoo计划的NetBSD开发者[7][8]

OpenRC是GentooAlpine LinuxHyperbola GNU/Linux-libreParabola GNU/Linux-libreArtix Linux英语Artix LinuxMaemo LesteTrueOS[9]和其他类unix系统的缺省init系统,而其他一些发行版比如Devuan把它作为一个选项提供[10]。这意味着这些支持它的系统/发行版的软件包和守护进程(daemon),带有或使用可获得的脚本。

设计

[编辑]

OpenRC构成自一些模块组件,主要的组件是init(可选)、核心依赖管理系统和守护进程监管器英语Process supervision(supervisor)(可选)。它用C语言和遵循POSIX的shell写成,这使得它在BSD和Linux系统上可以使用。

OpenRC的核心部分处理依赖管理和init脚本分析。OpenRC通过扫描运行级别,建造依赖图,接着启动需要的服务脚本来工作。一旦脚本都已经启动它就退出。缺省的,OpenRC使用一个修改版本的start-stop-daemon用于守护进程管理[11]

init脚本享有与SysVinit使用的脚本的相似性,但是提供了一些特征来简化它们的创建。脚本都假定有start()stop()status(),而系统使用已经声明的变量来创建这些缺省函数[12]。使用依赖函数来声明对其他服务的依赖性,这在SysVinit中是用LSB头完成的。配置和机制是分离的,分别采用在conf.d目录中的配置文件和在init.d目录中的init文件。

Openrc-init首先出现在版本0.25中,用作对/sbin/init的可选的替代。还支持一些其他init包括SysVinitBusyBox[13]

监管守护进程(supervise-daemon)首次出现在版本0.21中,给予openrc监管能力。它可以在init脚本中启用,用作启动和监控一个守护进程的监管守护进程。支持一些其他其他守护进程监管器包括runit[14]和s6[15]

特征

[编辑]
  • 在Linux、TrueOS、FreeBSD和NetBSD之间可移植。
  • 并行的服务启动(缺省关闭)。
  • 基于依赖的引导。
  • 通过cgroups的进程隔离[16]
  • 每服务资源限制(ulimit)。
  • 代码和配置分离(init.d / conf.d)。
  • 可扩展的启动脚本。
  • 有状态的init脚本(它已经启动了吗?)。
  • 启动多个组件的复杂init脚本(Samba(smbd和nmbd),NFS(nfsd、portmap等))。
  • 自动的依赖计算和服务定序。
  • 模块化架构和可选组件的分离(Cronsyslog)。
  • 有表达力和灵活性的网络处理(包括VPN,网桥等)。
  • 冗长调试模式。

引用

[编辑]
  1. ^ Release 0.54.2. 2024年6月28日 [2024年7月24日]. 
  2. ^ openrc, Analysis Summary (Ohloh), [2012-03-10], (原始内容存档于2012-11-05) 
  3. ^ openrc-0.43.3. [2021-04-16]. (原始内容存档于2020-11-05). 
  4. ^ DistroWatch.com: Put the fun back into computing. Use Linux, BSD.. distrowatch.com. [2020-04-04]. (原始内容存档于2020-11-17). 
  5. ^ 5 Differences Between TrueOS & Linux. [6 April 2020]. (原始内容存档于2020-11-17). 
  6. ^ Improving TrueOS: OpenRC. [6 April 2020]. (原始内容存档于2020-04-06). 
  7. ^ History. [6 April 2020]. (原始内容存档于2018-02-18). 
  8. ^ Developers. [6 April 2020]. (原始内容存档于2011-07-19). 
  9. ^ 4. Post Installation Configuration — TrueOS® User Guide. www.trueos.org. [2017-03-12]. (原始内容存档于2017-09-18) (英语). 
  10. ^ Devuan ASCII 2.0.0 stable release. [2018-07-17]. (原始内容存档于2018-09-23) (英语). 
  11. ^ user guide. [6 April 2020]. (原始内容存档于2021-12-11). 
  12. ^ service script guide. [6 April 2020]. (原始内容存档于2020-11-11). 
  13. ^ OpenRC. [2020-11-15]. (原始内容存档于2021-01-25). 
  14. ^ runit guide. [6 April 2020]. (原始内容存档于2021-03-08). 
  15. ^ s6 Guide. [6 April 2020]. (原始内容存档于2019-03-06). 
  16. ^ CGroups Support. [5 April 2020]. (原始内容存档于2021-01-25). 

外部链接

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
OpenRC
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?