From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id E9A75C5E3; Wed, 26 Nov 2025 21:34:58 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 5902BC4D4; Wed, 26 Nov 2025 21:34:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) by atuin.qyliss.net (Postfix) with ESMTPS id E6814C42E for ; Wed, 26 Nov 2025 21:34:42 +0000 (UTC) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id DC20A1D00156 for ; Wed, 26 Nov 2025 16:34:40 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Wed, 26 Nov 2025 16:34:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1764192880; x= 1764279280; bh=IQjF+mMk3UQN4jJ3K3YJ0PuHt9BCwWinzzb80nucv3U=; b=K 9z0ybufffaCweVvXNKG+f/yA9a7U1GbHHGX9DtKTnGE3xB5jhe10bVKB29FKLw4b zphZqXYDC3+B2E3UyDqdAJDOMEwqAnUWJDz0perR9XcYYQfR7mqikDysblc0Z/P3 bUKRWuJAgH4gvOPNCM5Jktn/y3Z+c8BmGmec61/0q6Y9cmjLtNi77l5X9QI7wOnd EhxZqK09NjvDmvcR8/g6p33geeZarWknZoyWlCy6KWzpRUsY2Kzm5TtbMzxmOe+z /X5w8q76VP6hy9trptVhFiy0eWN+tSD1CUBBG8BZ8OTApjXzx4lkxmw+aUE8tuRQ b6IHbYgT5+7+HFunIDYMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1764192880; x=1764279280; bh=IQjF+mMk3UQN4jJ3K3YJ0PuHt9BC wWinzzb80nucv3U=; b=Q6C+uFtDdHK0dacoxRx7Tba0jAIHydd0p0jsIBGjBXil eT5uOgpV9Bvei1/g3R55FfLrUf9zXoEudrgjK4azdi+U0gHo8Ap7LHBr1t1U/AUZ rJNoaZSi7ypT/MXeMXQQyuYbWHF+rJ8eaxs1sj1C7IA2mLwSl1vShRLrW1IvokXi TRbhHzg/PpZk2DGoTxs8AlIX5v4IVz5GSK68ZV4aqKdLeTuuF4htGQ3/QH33lrKN a301dYw7aZ/T9/pNXuBZV+AsVsmtsaGYcgeNi3GZXbmO8rV3cvbrmnxplICqqufR /yfP8ZQLq32c/WcwvNDV8tt3u12vcx99SX3c4kR6pA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvgeehgeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekredtre dttdenucfhrhhomheptehlhihsshgrucftohhsshcuoehhihesrghlhihsshgrrdhisheq necuggftrfgrthhtvghrnhepgfefudekvdelieelledufeevheeglefggedvudejvddtff euueevffehleejkedvnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghi lhhfrhhomhephhhisegrlhihshhsrgdrihhspdhnsggprhgtphhtthhopedupdhmohguvg epshhmthhpohhuthdprhgtphhtthhopeguvghvvghlsehsphgvtghtrhhumhdqohhsrdho rhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 26 Nov 2025 16:34:40 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 03F0F2981B51; Wed, 26 Nov 2025 22:34:19 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 10/13] img/app: pipewire: run as non-root Date: Wed, 26 Nov 2025 22:34:03 +0100 Message-ID: <20251126213407.1773744-10-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126213407.1773744-1-hi@alyssa.is> References: <20251126213407.1773744-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: ARJW5SKVAKNF4J7V7X4OJT2UFVHPK34M X-Message-ID-Hash: ARJW5SKVAKNF4J7V7X4OJT2UFVHPK34M X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Set the real-time scheduling priority hard limit globally at boot, as recommended by the s6-softlimit documentation. Signed-off-by: Alyssa Ross --- img/app/image/etc/group | 1 + img/app/image/etc/mdev.conf | 4 +++- img/app/image/etc/passwd | 1 + img/app/image/etc/s6-rc/pipewire/run | 4 ++++ img/app/image/usr/bin/init | 4 +++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/img/app/image/etc/group b/img/app/image/etc/group index 5eafb82..0bf6579 100644 --- a/img/app/image/etc/group +++ b/img/app/image/etc/group @@ -1,2 +1,3 @@ wayland:x:1:wayland wireplumber:x:2:wireplumber +pipewire:x:3:pipewire diff --git a/img/app/image/etc/mdev.conf b/img/app/image/etc/mdev.conf index b7c0c5b..d4cd825 100644 --- a/img/app/image/etc/mdev.conf +++ b/img/app/image/etc/mdev.conf @@ -5,7 +5,9 @@ $INTERFACE=.* 0:0 0 ! +/etc/mdev/iface $MODALIAS=virtio:d0000001Av.* 0:0 0 ! +/etc/mdev/virtiofs dri/card0 wayland:wayland 660 +background { /etc/mdev/listen card0 } -snd/controlC0 0:0 660 +background { /etc/mdev/listen controlC0 } + +-SUBSYSTEM=sound;.* pipewire:pipewire 660 +snd/controlC0 pipewire:pipewire 660 +background { /etc/mdev/listen controlC0 } # Don't change mode of other device nodes created by devtmpfs. .* 0:0 0 ! diff --git a/img/app/image/etc/passwd b/img/app/image/etc/passwd index 5557240..631554c 100644 --- a/img/app/image/etc/passwd +++ b/img/app/image/etc/passwd @@ -1,3 +1,4 @@ root:x:0:0:System administrator:/run/root:/bin/sh wayland:x:1:1:wayland-proxy-virtwl service user:/:/usr/bin/nologin wireplumber:x:2:2:WirePlumber service user:/:/usr/bin/nologin +pipewire:x:3:3:PipeWire service user:/:/usr/bin/nologin diff --git a/img/app/image/etc/s6-rc/pipewire/run b/img/app/image/etc/s6-rc/pipewire/run index afaada1..3925f08 100644 --- a/img/app/image/etc/s6-rc/pipewire/run +++ b/img/app/image/etc/s6-rc/pipewire/run @@ -27,6 +27,10 @@ fdclose 5 # Wait for sound devices to be available if { /etc/mdev/wait controlC0 } +nice -n -11 +s6-softlimit -P 88 +s6-setuidgid pipewire + export LISTEN_FDS 2 getpid LISTEN_PID pipewire diff --git a/img/app/image/usr/bin/init b/img/app/image/usr/bin/init index 6424e22..aca6efa 100755 --- a/img/app/image/usr/bin/init +++ b/img/app/image/usr/bin/init @@ -1,5 +1,7 @@ #!/bin/execlineb -s0 # SPDX-License-Identifier: EUPL-1.2+ -# SPDX-FileCopyrightText: 2022 Alyssa Ross +# SPDX-FileCopyrightText: 2022, 2025 Alyssa Ross + +/bin/s6-softlimit -HP 88 /bin/s6-linux-init -Bc /etc/s6-linux-init -- $@ -- 2.51.0