From nobody Tue Jun 16 17:09:12 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 4gftkx05mhz6hTbL for ; Tue, 16 Jun 2026 17:09:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 4gftkv0zSLz4MvT for ; Tue, 16 Jun 2026 17:09:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20251104 header.b=cA71S4dI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::52e as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-c85822059d8so3031285a12.1 for ; Tue, 16 Jun 2026 10:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781629765; x=1782234565; darn=freebsd.org; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XpHN5pcyNeLLXDU2nJHOnGtJLGvBP9F6njwZasDc1oo=; b=cA71S4dIzQl96zMmaKXU3goGoK3v1gQ7psGgwBepwGcqRihAJb1hEQSVn3+FHIAqPx hM6mRIMkpQFV7rNCdBYxmPAvuDd82lb9q4SrNql11k2qSoDTc2DKT64Z0JldCNShpHm5 QNsSGesoQi2c3vPmfZN2WreNqCBw8a0KWSbfPARmubDs8ikhI1uznQ/Q+1uhZmmtz3U4 DB9h16Q2pCKpyYAA3TYA3M5mnoXWuATlhpu8W9emyLEzPpulJs0D40+aFs288vmBur2T HKR1gwI8g0dVhFZqayhWj6Ek+yixBD9E+nLDMIR5mjg/o/7NFhc7rIwmqdV7y9qg5hJi GL5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781629765; x=1782234565; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XpHN5pcyNeLLXDU2nJHOnGtJLGvBP9F6njwZasDc1oo=; b=L9Zy0y3Xmi5kqsijmNQizhlp731Ibd9Ek87DcZa1XBHrtZ9nL4jOrgw515I16C7dEx f7lMIXlE2M20vh4jLPwKArfGXANpZtje1Gtnt8XPl/ZcH2+LPMx+qvmM7HNEwKf+qBeU oqvBmV++oZbUR+RGhDAvKDTe2UV7B0Is7kjadGCEYYzTIvelcIMkY/MO6f5Crvd+IiXV fnlwtbn/gmd5b63gYF72Oiti+oOWfudMe9PcjLsbkVdUNxC5FPZkeA59NbLY0XlkXL1h W9DVHByFgA5UJ7rNIsx9wvPEGGgWRtLkZNCyVf66XI2nJ6MjPw0r+d3mrB+zqn/fAUYV rWXg== X-Gm-Message-State: AOJu0YyY1DqWsMGU8luhiGJoGVrAeUzqoZfFfNNPVKJzYuAGUuinO2D8 fMzAy5/rgqP/VL+uGuadw5Ttln9w+VZfR4eJH3DRfjgyJp3zunXyhilL X-Gm-Gg: Acq92OHsGYAyyih6q98Rd6m+SzonVLZy6nEpRam/EW7ufQR8FDBvA07qK4u45LdHd7b GAkQtC9SWRMTJDzLk4sdkoHv77Pg92MEoZDVYV9Sr7m5zj2RyanD4bYtNMdAZlMr2ei9mmveSPl 2ebIWSdpCLFK5Ag+VYDzZEjD+NYo7oUpMH22ssgnsj9d1NsK1yNTMoKuC3giO50pWwns2eS6LiZ 2bvpCtVhJtRg9BUufX34/lbL/O7DxhsIRpfnR5CgE5Jc0YZYi1c5SJudn71ibTH24kFCU6dYhKv nSwcM5UU4FA9WWR9I6on4YDEikiFWE5yNooqYc3g5ndFtxstHCdEBXHgv9CH25oWGKwp0YjNiXL RUTZY2w9opu7oEsJjHhHNUzYkjZ2GyUYNuFtxcNN/hBpIlg/R+tbBYjHbfzdMN53uxqD1Q6V2j1 WXtKqrGkx1CHKJ+AGL+3/jVAK+48qe/R1mdy46RNrJS3VB9w== X-Received: by 2002:a05:6a21:3297:b0:3b2:a809:ffe with SMTP id adf61e73a8af0-3b8b6372c56mr244106637.14.1781629764690; Tue, 16 Jun 2026 10:09:24 -0700 (PDT) Received: from smtpclient.apple ([162.118.1.182]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c866519ef8dsm11768602a12.25.2026.06.16.10.09.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2026 10:09:23 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_01E0C1D6-4C2C-483E-B275-283017A99296"; protocol="application/pgp-signature"; micalg=pgp-sha256 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 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: rcd(8) - new service manager daemon From: "Enji Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 16 Jun 2026 10:09:12 -0700 Cc: "hackers@freebsd.org" Message-Id: <2B5C1CB6-BAE5-460D-AAC7-B4E488F3BF79@gmail.com> References: To: Baptiste Daroussin X-Mailer: Apple Mail (2.3864.600.51.1.1) X-Spamd-Result: default: False [-5.59 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.994]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20251104]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; HAS_ATTACHMENT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[hackers@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52e:from] X-Spamd-Bar: ----- X-Rspamd-Queue-Id: 4gftkv0zSLz4MvT --Apple-Mail=_01E0C1D6-4C2C-483E-B275-283017A99296 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 14, 2026, at 12:26=E2=80=AFPM, Baptiste Daroussin = wrote: >=20 > Hello everyone >=20 > 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 = 15 > years ago or some discussion in BSDcam also that old! > I would like to start a discussion about its integration into the = tree. >=20 > What is rcd? >=20 > 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). >=20 > Key features: >=20 > - 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 >=20 > User interface: rcctl(8) >=20 > Service management is done via rcctl(8): >=20 > rcctl start sshd > rcctl enable sshd > rcctl restart dhclient@em0 netif@em1 > rcctl status > rcctl show nginx >=20 > 100% backward compatibility >=20 > 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: >=20 > 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. >=20 > 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. >=20 > 3) All rcctl(8) commands are passed through to the script directly: > rcctl reload sshd -> /bin/sh /etc/rc.d/sshd reload >=20 > 4) Template instances preserve the traditional calling convention: > rcctl restart netif@em0 netif@em1 > -> /bin/sh /etc/rc.d/netif restart em0 em1 >=20 > 5) rcd reads /etc/defaults/rc.conf, /etc/rc.conf and > /etc/rc.conf.local to determine legacy service enablement. >=20 > 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. >=20 > Current status and what I need >=20 > I would like to commit this to main soon so that people can start > testing it on their machines. The initial commit will include: >=20 > - 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 >=20 > 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. >=20 > Migration path >=20 > The plan for a smooth transition: >=20 > - 1 (now): Commit rcd(8) and rcctl(8) to the tree. Build by > default, but not activated. Early adopters can test. >=20 > - 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. >=20 > - 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). >=20 > - 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. >=20 > The code lives there: > https://reviews.freebsd.org/D56835 Some scenarios to consider: - What happens if rcd dies? Who respawns it? - How are UCL/schema changes tracked and how are upgrades/downgrades = handled? It would be unfortunate if someone installed a version of world = (for instance) that did not interoperate with rcd. A general request: - Please avoid the monolithic mess that is systemd and keep the = dependency list (directly linked libraries) small. systemd is fast, = all-singing-all-dancing, but of the Linux systems I manage, I can=E2=80=99= t tell you the last time I didn=E2=80=99t have to do a reboot after an = update because a library was upgraded or there was an issue found in the = systemd ecosystem. I get frequently nagged by unattended-updates about = needing to manually poke services. The rcd architecture avoiding DBus = helps this to some degree, but I want to caution against tightly = coupling everything like systemd does (it makes the ecosystem into a = maintenance nightmare). Thank you, -Enji= --Apple-Mail=_01E0C1D6-4C2C-483E-B275-283017A99296 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkHfexGRJ3gYRdA2gGpE5DjPsNJgFAmoxgzgACgkQGpE5DjPs NJjB8A//WR3LH1PgusLK/lD+4Lh3wX/Ovya9zs/wtGmadXCCJnZ3OWxlMHcLbslc 8aNro/HqhilDDqdFfBhFcXUC/mUDfedAlV53gJKRIHKxcMXq2RZvvIdq4ZWR89tS JyBaOi+E9QKyZcSZbyhMeKI7EOyWUXMYONLqhcAMN6KgFPQFqAaS1e5EUZmEumPk qE7LbssC+dURCQ0/YCE24/04KCBHP5lmY907kS+8RICNX7ZTUSUQONB37RECLfKI pr6myaE0nRriMy0WmNW20CfcpgXCjmDI1nxtidKh0zuArZaYldvLpGZqwixqid8j Rg7WuwejnBUJ0NMAmMV7+gDabVdk7Hc8iKL5AzTFEfogrxxRgNzizfFLHj7bwMP3 GwUqlgkrwOOEM7od8GTVS9yi+mF2ZC/zJT8v9p0ZjdG7QHRhLrAPlkCBI3hvR1CJ WQ1+nQpQVAYocNUaPHZAj3+eIzOCINKpFaB3BxvRpTftYhfR3niurbHbze6CO4vy 0fRSsFxDvqsiRoeqKd71kqvUfXsBHuznSsoXv6yzFQVmAv/CoUByNszCcgu7SldF MqNZuEQqvUaM5wjMS9VXH5hpPeCQGDeefHnk0BWk/Ah+88auaTZ0DKJk4auDviT7 5ctLvTSUrq266rOreb+KNQJlMhhfd6P1ToH/7wvWZmqJQWWGLX0= =kPg6 -----END PGP SIGNATURE----- --Apple-Mail=_01E0C1D6-4C2C-483E-B275-283017A99296--