From nobody Mon Apr 6 20:38:47 2026 X-Original-To: ports-bugs@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 4fqLlC6tkgz6Xxv7 for ; Mon, 06 Apr 2026 20:38:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fqLlC6Qfyz3lcr for ; Mon, 06 Apr 2026 20:38:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775507927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=31zAKpKuRl61Ck2TBRacY3UOL85G1k7FKSBorAD/uag=; b=SdbsWL5Hp54fCzKvqkZUAncypHsRKVyca+JSY87AZZpJcer7SdOFS8rb7Q0lHxsDSHH/63 CIPAC/ENk+ABpUb0/7rgWHz299FGKgiTBZXYgc9RwfhyupgqTNiJHwM4+gf5LdZIdU8FEY XHzcqHoi/q68+Bs2/3x8aPZ3UudsM2yijP6fwC1nVskaBWOHeOwUJ7M0Fvv03OR5D+pJWP rHuDzlJ6DjmK8Rguwn1i6uyUHNgWryS7r6mxzHxLQMgHTfQ8nKLwQNzwhHeOn2h4CNJz4y 2Nr6vkaNvzjMY2mY8nU5X2pMnOo35qF7o7My0SmgbnseOeY1ae5kdgPf1kQTtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775507927; a=rsa-sha256; cv=none; b=kkysI9e5dNn6KVgl/OFDNNUKmkehsv7UGA2M2LodLFyOv2toMTzPK0CCPBmgYPDHkcltpD I81b6wqe7nJvYPjRUwbstbSWpogT3Yqk8B3Abv2WFbNf1H3UhSXOOxjb2livoUsIuMXx0o IQ7fLpRcIQ+aHmvW0pZWU9J83Jbg2vqib1i1kGYpTE4ZOgdB9hoONb22k+atVCgUjQXz93 93yyoTAFqJI3S4AI2q8V68YvB2tRrVBlecszrZHBAADPy3Rw/kJn+ewmBpab07Zsz+ErkD 3CzAQZB3F+N7kGxC1OsATY6/pnGdE2/KQxiiYH2pg/BTpBKayfTbNEOl0cOdJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775507927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=31zAKpKuRl61Ck2TBRacY3UOL85G1k7FKSBorAD/uag=; b=hJUfuWA6gT0QIO8AYEyxgYn5A3yI9KprAyPyvUtWaFzGi2i7d7MhOzgUO6hdwKtBJSbS3U yfjSJ5k3+obZHx6ZwqLQwdgR6ehoTkyx6j1a4Uz05iaJX8NJKjd3melszIGPXQyW7PTJOq olpkJTQOZXLYJjOmH4ADYu2dkeWPruXa2BTHUBWk3e0MEwNfE+1K84NIDQ+b6PkGzregpa qG1Z1AEkZuEX9WAuv9t0PlFLKCXMBzdBClxQuUMUads+BuxUbM3npN3RK7Rnu1geTjPaYC EUSEE6LdSfV2EKMx/Tz2YPPy6X/L0c1FsgDjXhM7X55m7Cz88BUdLOsObDJO6w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4fqLlC5qVnz17Dr for ; Mon, 06 Apr 2026 20:38:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 636Kcl71026359 for ; Mon, 6 Apr 2026 20:38:47 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 636KclbM026358 for ports-bugs@FreeBSD.org; Mon, 6 Apr 2026 20:38:47 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 294288] sysutils/alloy: service alloy restart fails with stale pidfile Date: Mon, 06 Apr 2026 20:38:47 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: andy@codeedog.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-ports-bugs@freebsd.org Sender: owner-freebsd-ports-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D294288 Bug ID: 294288 Summary: sysutils/alloy: service alloy restart fails with stale pidfile Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: andy@codeedog.com CC: zach.leslie@grafana.com CC: zach.leslie@grafana.com Flags: maintainer-feedback?(zach.leslie@grafana.com) Behavior -------- `service alloy restart` fails intermittently with "already running?" after the stop phase completes. A second restart succeeds. The issue is consistent and reproducible on every first restart attempt after a clean start. To reproduce: `service alloy restart` Observed output: Stopping alloy. Waiting for PIDS: 11317. alloy already running? (pid=3D11317). A second restart will succeed. The pid file `/var/run/alloy.pid` persists after the alloy process exits. The start phase finds the stale pid file and refuses to start. Environment - FreeBSD 15.0-RELEASE-p2 (amd64) - alloy-1.10.2_8 from pkg - Running inside a VNET jail (reproduces on host as well) Code Analysis ------------- Root Cause The rc.d script (`/usr/local/etc/rc.d/alloy`) is missing the `-f` flag on the `daemon(8)` invocation. Without `-f`, daemon forks the child process, writes the child PID to the pidfile, and exits immediately. No supervisor process remains to clean up the pidfile when the child exits. command_args=3D"-S -T ${name} -p ${pidfile} /usr/bin/env ... Proposed Fix Two changes to `/usr/local/etc/rc.d/alloy`: 1. Add `-f` to `command_args` so daemon stays as supervisor: command_args=3D"-f -S -T ${name} -p ${pidfile} /usr/bin/env ${procna= me} ${run} \ 2. Add `stop_postcmd` to remove the pidfile after stop: start_precmd=3Dalloy_startprecmd stop_postcmd=3Dalloy_stoppostcmd And add the function: alloy_stoppostcmd() { rm -f ${pidfile} } Testing Tested on FreeBSD 15.0-RELEASE-p2 in a VNET jail. With the fix applied: - `service alloy restart` succeeds on every attempt - Three rapid successive restarts all succeed - `service jail restart` (full jail stop/start cycle) succeeds - daemon supervisor process visible in ps output - pidfile cleaned up after stop Unsure if Bug #292472 is related. --=20 You are receiving this mail because: You are the assignee for the bug.=