From nobody Wed Jun 17 11:23:00 2026 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ggM0t3cV5z6hBsK for ; Wed, 17 Jun 2026 11:23:10 +0000 (UTC) (envelope-from h4ckee@proton.me) Received: from mail-24431.protonmail.ch (mail-24431.protonmail.ch [109.224.244.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggM0r0G7Lz3TkD for ; Wed, 17 Jun 2026 11:23:07 +0000 (UTC) (envelope-from h4ckee@proton.me) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=proton.me header.s=protonmail header.b=W30bqxam; dmarc=pass (policy=quarantine) header.from=proton.me; spf=pass (mx1.freebsd.org: domain of h4ckee@proton.me designates 109.224.244.31 as permitted sender) smtp.mailfrom=h4ckee@proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1781695385; x=1781954585; bh=1wbh8zcun0R/IibrlxKSEATFCaQgbclG65NqDNfvty8=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=W30bqxam/9/0nJnbf7f8b7eJqlHkveAVG66Kdo8mCBrJ2NXogDWYFAau6GQa0daBb uZ7ib3QxiG3m3hNpcxU9kP0iexbYijwKv+uZGHO7DnlvVQFiZb0bl69oYp+d+QbPRj xicFk9APlWVB1krNHmll1jcIWUtgj+nzd33bgABz+5NTtjgKjU8frALpCL9j/Vfmj5 zLzzi1xqyMXlpngxbGl96zqtRuTgp1WlWu5xoNTU+mmGsA78+7Eyi2uNK2cAviK4pC YvZODlR1VFOc7KtlDqwxDXFFzflpPMupDaGULA6hCzysiXYMAi83wQxzjXUGHziiuc oLvSElgIqrdgg== Date: Wed, 17 Jun 2026 11:23:00 +0000 To: hackers@FreeBSD.org, Baptiste Daroussin From: hackee Subject: Re: rcd(8) - new service manager daemon Message-ID: <4ql1C4GIt0xEItg5UNq6B3LGgVlvsZUE6ckiHU95v0SKxb6RtF2_RlaYKzb0xDhALOF3j1PBiW0fgfOUlJWwMJRAHB1CV9fTJyseMYlJfzY=@proton.me> In-Reply-To: <86pl1sap93.fsf@gmail.com> References: <86pl1sap93.fsf@gmail.com> Feedback-ID: 57180569:user:proton X-Pm-Message-ID: 92ce0491d17bd1843534ea2022bbae09b85beb13 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-4.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.995]; DMARC_POLICY_ALLOW(-0.50)[proton.me,quarantine]; RWL_MAILSPIKE_EXCELLENT(-0.40)[109.224.244.31:from]; R_DKIM_ALLOW(-0.20)[proton.me:s=protonmail]; R_SPF_ALLOW(-0.20)[+ip4:109.224.244.0/24]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[109.224.244.31:from]; ARC_NA(0.00)[]; ASN(0.00)[asn:62371, ipnet:109.224.244.0/24, country:CH]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[hackers@FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[proton.me:+] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4ggM0r0G7Lz3TkD Hi. As for me, I don't care, I wrote my own init scripts (mksh based) and use t= hem. Boot time is about 7.5 seconds. BR.=20 > Hi, >=20 > This is honestly great! I must admit the long bootup times - while > *fine* - have always been kind of annoying, and having something > backwards-compatible that improves on that (and, I assume, is generally > more modern) is very appealing to me. I will be testing it ASAP. >=20 > Do you have an estimate as to how much time is saved from specifically > the parallelisation? >=20 > Warm regards, > C=C3=A9leste >=20 > Baptiste Daroussin writes: >=20 > > Hello everyone > > > > I have been working for the past years on rcd(8), a new service manager > > daemon for FreeBSD, some of you might recall a presentation in french 1= 5 > > years ago or some discussion in BSDcam also that old! > > I would like to start a discussion about its integration into the tree. > > > > What is rcd? > > > > rcd(8) is a service manager daemon called by init(8) (in place of > > /etc/rc). It reads service definitions from UCL unit files > > (/etc/rcd.d/*.ucl), builds a dependency DAG, and starts services in > > parallel. After boot completes, it forks to background and stays > > running as a supervision daemon (automatically restarting failed > > services and accepting control commands via a UNIX socket). > > > > Key features: > > > > - Parallel boot via dependency DAG (no more serial rc.d execution) > > - Process tracking via pdfork(2) descriptors (no PID file races) > > - Subreaper via procctl(2) (no orphaned process escape) > > - Socket activation (pre-bound sockets passed via fd inheritance) > > - Resource control per service via rctl(2) > > - Service isolation via native jail(2) integration > > - OOM protection via procctl(2) PROC_SPROTECT > > - UCL-based unit files (JSON Schema validated) > > - Embedded Lua interpreter for inline service hooks > > - Template units for per-instance services (e.g., dhclient@em0) > > - Safe in-place binary upgrade (SIGUSR1: save state, re-exec) > > - Per-service access control on the control socket > > - Suspend/resume support > > > > User interface: rcctl(8) > > > > Service management is done via rcctl(8): > > > > rcctl start sshd > > rcctl enable sshd > > rcctl restart dhclient@em0 netif@em1 > > rcctl status > > rcctl show nginx > > > > 100% backward compatibility > > > > This is a hard requirement: rcd must work on existing FreeBSD systems > > without modifying any rc.d scripts or configuration files. Here is how > > this is achieved: > > > > 1) rcd scans /etc/rc.d/ and /usr/local/etc/rc.d/ for existing > > rc.d scripts, parses their PROVIDE/REQUIRE/BEFORE/KEYWORD headers > > (same format as rcorder(8)), reads rc.conf(5) to determine the > > enabled state, and wraps each script as a virtual "legacy" unit > > in the dependency graph. > > > > 2) Legacy scripts are auto-classified during loading: > > - Scripts with pidfile=3D or command=3D -> "legacy-forking" units, > > tracked by rcd-exec(8) sub-reaper without pidfiles. > > - Scripts with only comments/blank lines -> barrier units. > > - Scripts without rcvar=3D are always enabled. > > > > 3) All rcctl(8) commands are passed through to the script directly: > > rcctl reload sshd -> /bin/sh /etc/rc.d/sshd reload > > > > 4) Template instances preserve the traditional calling convention: > > rcctl restart netif@em0 netif@em1 > > -> /bin/sh /etc/rc.d/netif restart em0 em1 > > > > 5) rcd reads /etc/defaults/rc.conf, /etc/rc.conf and > > /etc/rc.conf.local to determine legacy service enablement. > > > > The result: you can install rcd on a running system, reboot, and > > everything works exactly as before -- except boot is faster because > > services start in parallel where the dependency graph allows. > > > > Current status and what I need > > > > I would like to commit this to main soon so that people can start > > testing it on their machines. The initial commit will include: > > > > - sbin/rcd/ -- the daemon, rcd-exec helper, unit tests > > - sbin/rcctl/ -- the control utility > > - Man pages: rcd.8, rcctl.8, rcd.conf.5, rcd.d.5, rcd-lua.3, > > rcd-exec.8 > > > > It will NOT change init(8) or /etc/rc yet. rcd will be built and > > installed but not activated by default. To test, you will be able to > > run it manually or configure via kenv(8) to replace /etc/rc. > > > > Migration path > > > > The plan for a smooth transition: > > > > - 1 (now): Commit rcd(8) and rcctl(8) to the tree. Build by > > default, but not activated. Early adopters can test. > > > > - 2 (later): Commit init(8) changes to call rcd when present (falling > > back to /etc/rc otherwise). Provide a /etc/rc wrapper that invokes > > rcd for systems that want to switch. > > > > - In the meantime: convert base system rc.d scripts to native > > UCL unit files adding the norcd keywords to the rc.d so that they > > are not read anymore by rcd(8). > > > > - Ultimately: rc.d -> unit files, at the pace each maintainer sees fit. > > There is no deadline; rc.d scripts are supported as long as needed. > > > > The code lives there: > > https://reviews.freebsd.org/D56835 > > > > Baptiste >=20 >