From nobody Mon Jun 15 18:17:40 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 4gfJJM5d2Pz6hjcG for ; Mon, 15 Jun 2026 18:17:55 +0000 (UTC) (envelope-from biancalana@gmail.com) Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfJJM3Hjfz4KmS for ; Mon, 15 Jun 2026 18:17:55 +0000 (UTC) (envelope-from biancalana@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-4875fff6a7cso86530b6e.0 for ; Mon, 15 Jun 2026 11:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781547472; cv=none; d=google.com; s=arc-20240605; b=IkwyJurLcSVAvXtzCchxPbdz109Uqb/0FFKLkbddnlZjtSH4t1CQ+xsptPlrOv7bRh Lc2PIRxd9OdlfIehwV/MaL1OHLm9HfGgKwu6gz3qAK1H8Nq6E0SqGWFDcmxbp+R3Fkuh UGDtA1Oz8tdn3kYftElb3N3UskJVYkh32Ai921H9Agzyb9iiFe5fIUNNX8J94Kky5jls fU6U+AMUuHTVrMFq3z7RkCf7kP37I60zxKndUqPj/uoZ7bOK+B7iLHx6E7LbRGbEyP70 92BP/s5BT+sD/rB/HLMbJ+Ev/2RJf5XY9SJYUr6Q9koV8ox8PXC9uAgq/of0Cr0HF8rZ 9Gvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=QeIOjfADvaEkkbB1bmesxdblGWjaX4DaS4Zt0HHC2RE=; fh=jU/ERF9bS+dGw7O1QNJBcp6AxIb5hIVW6f4szjHTjDM=; b=TbJC6YAyhT3ayGpTjKe79ABu4h0TFZBy7ez1uUWSshWr81ihlWmir2ohrdVk5YRX7x 11ho2LsN87P48nH5kluvjuvvETu2QVnNVcx2mbTHjUZlsYZnES3OsuWUVe0NMzRDMTLC 8tL3t8G70KMdBTekcs616UZwBA+Md/HIajQvds0mOBpoXe6jGQNKapBGV2T5DPi+IrnK XA0+d78QhEsEXitAa4OEwS8okOUwopaoTfJhsRN4JXH4Ygl63qGcjAu8IoXodxLlJtf5 1ikOYbsmIxHrUgvJNclDn8ZbU/iX+gMFsCR15UHlTJCGgjL9vE+dGajj2DH7Mut1LXuD B9xA==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781547472; x=1782152272; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QeIOjfADvaEkkbB1bmesxdblGWjaX4DaS4Zt0HHC2RE=; b=NETXi5TnZ8QhuQuqrRUpKsYkqnZQT2JNriXUjsnuQxilI77FmXbVdW8XHLKf8MLGD/ vL0LTr1OEiVA4nbAPvLvvarZ8IlIcyYI+Qi6gCMUoREOwcvI5FWCaI33Z/AFB5Lv+HTw Utl6a2DyC9xrRNuDQpR9x/NFhbYWPMqmNA+G0/pkK+SwNqo4Y67Cn4Ry7rXs2DayaVq/ gCYINEmReRr4jUP79DMzGFMAHtZ+xseUbJEdZmTB3UqJlLuLA3rSQdFxrZKCI+xZKVCi lxnjr+4Ry0OtVRJlxVLA7MQuHfK3hootjfinaaxcEVpSamrTu3zhF82V/WdoVtxhp2gf GdvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781547472; x=1782152272; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QeIOjfADvaEkkbB1bmesxdblGWjaX4DaS4Zt0HHC2RE=; b=ZKoNY6BX5xYFT6tPyGWFY7KJDddMfBqbH3LJOTeyp1dENrQ09ySvLdDNibEGAkr1j/ 6q3M6jDvH749LQF5HHNDVNYIQ4YeYK4Cn4WkFZXntN4hoc7YJXNvUBSooc2aV/5QD+Sn eUcwMHqP+dTdt54nrrgOI+7anpJOi6FaVnDMxmye16Zgz6+dnrBu7tv6Me6jXDt8KGym +Tfub0sdEp0nMGo14swfSMe4ptcIyCRrjVrk+L5/J5DD1Z6jhuj011GshxmF6S1OdFgA pum97zXcjsyQ6/AFviTPknOzXu7fvSjXk5W+qtqYHdORdxAAS1bDbZsdxMR1z5ZE6chw XczA== X-Forwarded-Encrypted: i=1; AFNElJ/69sJxJRP5BBFTDV41FIC0cxkl1fXv0NJIwhDnmGxAawxj4ouTRduCdIF8XXO9DphiyC8zcRGH@freebsd.org X-Gm-Message-State: AOJu0YwhEzUEIJxQP06E3oNd0/mY3b4le3JO9JIQzUg6Y/2OWDPC0dg/ mgOtqvLRGo6JR4sJu/XADgwJ94mbCLowp7CE9Ue1UxaOlCOdg8I5LqwdYLs56lMykRLaQvsHtVh gOIiyHOGiTtObemuY909P/lFyhZmOIz69sQ== X-Gm-Gg: Acq92OFyfsYNESmnIibDUvst+OC2zg11VoNFyCVzLwVZOXCkyJdruVHOuNIhjmW5mxz Ztx54yfm7rAGQW/pvU2K1p+OnvYcVT7b2+xwS1OQ45ZKcWz3Pzx+pd8qvAVZ65oMTuJnAl3nJNy 1ab5My+FdnqPdcqZsEcpBbI9ORmyUl1cNBfDB9chNwG7fPFwbW6INRPnleyrFMMJOyS8o320d44 sc2DWJFCsHudcWc/L2SOQfYdLJv9d2sYJUhZek2Jpze4eNHb5wFI2+WNdjFHwFVSMNlyq40sNM7 JpW6GDSIebCDBNpA9zZYJMAGKk3UtACwC29BGrZJPEMKi2Qs X-Received: by 2002:a05:6808:1790:b0:485:4601:9c9d with SMTP id 5614622812f47-4872f2f5af7mr5760503b6e.2.1781547472193; Mon, 15 Jun 2026 11:17:52 -0700 (PDT) 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 References: In-Reply-To: From: Alexandre Biancalana Date: Mon, 15 Jun 2026 15:17:40 -0300 X-Gm-Features: AVVi8CedL43n_7Mp_VtOI-M8OjIQagFrqiHSdcZiU75cKKtZloH4rt0ihRXWQVs Message-ID: Subject: Re: rcd(8) - new service manager daemon To: Alan Somers Cc: Baptiste Daroussin , hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000003b0c4506544ed8a2" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4gfJJM3Hjfz4KmS X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --0000000000003b0c4506544ed8a2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maybe having a port of rcd enable a broader testing until it reach -release On Sun, 14 Jun 2026 at 19:16 Alan Somers wrote: > On Sun, Jun 14, 2026 at 1:26=E2=80=AFPM Baptiste Daroussin > wrote: > > > > 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 > > This sounds turboawesome. Parallel boot, pdfork, procctl, and UCL, all > sound > very exciting to me. I can't wait to beta-test. And > backwards-compatibility, too, is super good. IIRC, the lack of > backwards-compatibility is why the NextBSD experiment failed. Since > you're the expert, could you tell us how else this rcd differs from > NextBSD/launchd? > > --0000000000003b0c4506544ed8a2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Maybe having a port of rcd enable a broader testing until= it reach -release=C2=A0

On Sun, 14 Jun 2026 at 19:16 Alan Somers <asomers@freebsd.org> wrote:
On Sun, Jun 14, 2026 at 1:26=E2=80=AFPM Baptiste Daroussin <<= a href=3D"mailto:bapt@freebsd.org" target=3D"_blank">bapt@freebsd.org&g= t; wrote:
>
> Hello everyone
>
> I have been working for the past years on rcd(8), a new service manage= r
> daemon for FreeBSD, some of you might recall a presentation in french = 15
> 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).=C2=A0 It reads service definitions from UCL unit files
> (/etc/rcd.d/*.ucl), builds a dependency DAG, and starts services in > parallel.=C2=A0 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:
>
>=C2=A0 =C2=A0- Parallel boot via dependency DAG (no more serial rc.d ex= ecution)
>=C2=A0 =C2=A0- Process tracking via pdfork(2) descriptors (no PID file = races)
>=C2=A0 =C2=A0- Subreaper via procctl(2) (no orphaned process escape) >=C2=A0 =C2=A0- Socket activation (pre-bound sockets passed via fd inher= itance)
>=C2=A0 =C2=A0- Resource control per service via rctl(2)
>=C2=A0 =C2=A0- Service isolation via native jail(2) integration
>=C2=A0 =C2=A0- OOM protection via procctl(2) PROC_SPROTECT
>=C2=A0 =C2=A0- UCL-based unit files (JSON Schema validated)
>=C2=A0 =C2=A0- Embedded Lua interpreter for inline service hooks
>=C2=A0 =C2=A0- Template units for per-instance services (e.g., dhclient= @em0)
>=C2=A0 =C2=A0- Safe in-place binary upgrade (SIGUSR1: save state, re-ex= ec)
>=C2=A0 =C2=A0- Per-service access control on the control socket
>=C2=A0 =C2=A0- Suspend/resume support
>
> User interface: rcctl(8)
>
> Service management is done via rcctl(8):
>
>=C2=A0 =C2=A0 =C2=A0rcctl start sshd
>=C2=A0 =C2=A0 =C2=A0rcctl enable sshd
>=C2=A0 =C2=A0 =C2=A0rcctl restart dhclient@em0 netif@em1
>=C2=A0 =C2=A0 =C2=A0rcctl status
>=C2=A0 =C2=A0 =C2=A0rcctl show nginx
>
> 100% backward compatibility
>
> This is a hard requirement: rcd must work on existing FreeBSD systems<= br> > without modifying any rc.d scripts or configuration files.=C2=A0 Here = is how
> this is achieved:
>
>=C2=A0 =C2=A01) rcd scans /etc/rc.d/ and /usr/local/etc/rc.d/ for exist= ing
>=C2=A0 =C2=A0 =C2=A0 rc.d scripts, parses their PROVIDE/REQUIRE/BEFORE/= KEYWORD headers
>=C2=A0 =C2=A0 =C2=A0 (same format as rcorder(8)), reads rc.conf(5) to d= etermine the
>=C2=A0 =C2=A0 =C2=A0 enabled state, and wraps each script as a virtual = "legacy" unit
>=C2=A0 =C2=A0 =C2=A0 in the dependency graph.
>
>=C2=A0 =C2=A02) Legacy scripts are auto-classified during loading:
>=C2=A0 =C2=A0 =C2=A0 - Scripts with pidfile=3D or command=3D -> &quo= t;legacy-forking" units,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 tracked by rcd-exec(8) sub-reaper without p= idfiles.
>=C2=A0 =C2=A0 =C2=A0 - Scripts with only comments/blank lines -> bar= rier units.
>=C2=A0 =C2=A0 =C2=A0 - Scripts without rcvar=3D are always enabled.
>
>=C2=A0 =C2=A03) All rcctl(8) commands are passed through to the script = directly:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rcctl reload sshd -> /bin/sh /etc= /rc.d/sshd reload
>
>=C2=A0 =C2=A04) Template instances preserve the traditional calling con= vention:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rcctl restart netif@em0 netif@em1 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -> /bin/sh /etc/rc.d/netif restar= t em0 em1
>
>=C2=A0 =C2=A05) rcd reads /etc/defaults/rc.conf, /etc/rc.conf and
>=C2=A0 =C2=A0 =C2=A0 /etc/rc.conf.local to determine legacy service ena= blement.
>
> 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.=C2=A0 The initial commit will include: >
>=C2=A0 =C2=A0- sbin/rcd/=C2=A0 =C2=A0-- the daemon, rcd-exec helper, un= it tests
>=C2=A0 =C2=A0- sbin/rcctl/ -- the control utility
>=C2=A0 =C2=A0- Man pages: rcd.8, rcctl.8, rcd.conf.5, rcd.d.5, rcd-lua.= 3,
>=C2=A0 =C2=A0 =C2=A0rcd-exec.8
>
> It will NOT change init(8) or /etc/rc yet.=C2=A0 rcd will be built and=
> installed but not activated by default.=C2=A0 To test, you will be abl= e 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.=C2=A0 Build by
>=C2=A0 =C2=A0default, but not activated.=C2=A0 Early adopters can test.=
>
> - 2 (later): Commit init(8) changes to call rcd when present (falling<= br> >=C2=A0 =C2=A0back to /etc/rc otherwise).=C2=A0 Provide a /etc/rc wrappe= r that invokes
>=C2=A0 =C2=A0rcd for systems that want to switch.
>
> - In the meantime: convert base system rc.d scripts to native
>=C2=A0 =C2=A0UCL unit files adding the norcd keywords to the rc.d so th= at they
>=C2=A0 =C2=A0are not read anymore by rcd(8).
>
> - Ultimately: rc.d -> unit files, at the pace each maintainer sees = fit.
>=C2=A0 =C2=A0There is no deadline; rc.d scripts are supported as long a= s needed.
>
> The code lives there:
> https://reviews.freebsd.org/D56835
>
> Baptiste

This sounds turboawesome.=C2=A0 Parallel boot, pdfork, procctl, and UCL, al= l sound
very exciting to me.=C2=A0 I can't wait to beta-test.=C2=A0 And
backwards-compatibility, too, is super good.=C2=A0 IIRC, the lack of
backwards-compatibility is why the NextBSD experiment failed.=C2=A0 Since you're the expert, could you tell us how else this rcd differs from
NextBSD/launchd?

--0000000000003b0c4506544ed8a2--