From nobody Wed Feb 05 19:55:38 2025 X-Original-To: dev-commits-src-main@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 4Yp9vb11j5z5mJN8; Wed, 05 Feb 2025 19:55:39 +0000 (UTC) (envelope-from git@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yp9vZ4pbgz42Pm; Wed, 05 Feb 2025 19:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738785338; 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=jbyuH6FsAyeDeRFSzZRnt1/H9H6reLldPW7Ah1xuIRI=; b=wtZwkcgMQWGq6IFYCYlB2sg7egSigqwSd+O2exhusyyRwNhMOQmG2Kmb12GCaglx/wfgnZ WgFf86dzYehNE88+yfuJ92OS3L3F1DemzcW8BnGGIwj2ZFOXxvgjLuz1uC3BppbZaLU0kE aRqP+gnCeWwQs4f0+1Vfy/gxgrbzd6sZZZQwdqpg7b4N5gbcAoOgkuwolk3ar6pzqhIyZn t6X/FYlGGeIgknokkRULycRF6gej7ZkAcGYgqFw4eJ7sdZLP/34PARzUitza7pk8kJcqIG hAcNc81jroCvIHW5IdR8eqGOcMxogUIRORPCNeFrOBrppzNCu6c0WySmHRgGTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738785338; 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=jbyuH6FsAyeDeRFSzZRnt1/H9H6reLldPW7Ah1xuIRI=; b=IqXoGwDydQMid1VbCcMRdcb/cTek+Ni5tcXviZCkdcahtdzIUVXEh29cLsbiSnB6LU3rlx wnmqtrwiLwrqnoEvodFyS8nMb/thWCqzA9zl7esxaq/92kPSwPIqbYjrICMPD/yqwgRzI0 KuM0bbuEsPo0QoSzIo30sV5WGmr7/9MOA0yKyPefPi3UD/KCl0yn5uKVuZLjVOyfCT1Fql 63zh7M7cjir3oXfp5ma6E8YMlYm52A6CzXX5v8djr83sJXM2D6R33eUlj58JqxX4ykRp3F g08ZnplSUHwP8Mkkbi2nMO0RA5FupwurW9WymsDbOEWm0TqvYtDYLZ97XzoLFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738785338; a=rsa-sha256; cv=none; b=PUHS7kZFSo2+/IrBjB/CRS1MrsUHg0H0qMY6n+GhN4sC+eqh1xM+78AIpzSVeH0xmJx3NF yUEaPD2PqY46YojolR7higYO9JxxyVhp9Png4HMuB/YU8apaBuqJyackhU8Vkumv3W4kWO 1gJ+GHkDsddPifWIFwoKSj008LrtmJhfY2DFDovIT7P9wT3x78J+fpTte+n2ZzIIFayweB 49Mm7EB1uh1AaiYDWwF9yG9axV/Vtw0raIbYs3kcpXZWJebOu27ZGzNEQqbnwBWjNGiVGb E16NfacWHhlyAAh4YixFIeueIyNv0TAeTOJvHkyfuk7I4tvGFiDi26/4do47gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Yp9vZ2lQsz15sZ; Wed, 05 Feb 2025 19:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 515Jtcm5087810; Wed, 5 Feb 2025 19:55:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 515JtckU087807; Wed, 5 Feb 2025 19:55:38 GMT (envelope-from git) Date: Wed, 5 Feb 2025 19:55:38 GMT Message-Id: <202502051955.515JtckU087807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7bad3c3e5f1c - main - ctld: Write the pidfile once after forking List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bad3c3e5f1c8b4d9e620bb2943299d4a30f3c86 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7bad3c3e5f1c8b4d9e620bb2943299d4a30f3c86 commit 7bad3c3e5f1c8b4d9e620bb2943299d4a30f3c86 Author: John Baldwin AuthorDate: 2025-02-05 19:53:14 +0000 Commit: John Baldwin CommitDate: 2025-02-05 19:55:16 +0000 ctld: Write the pidfile once after forking Don't rewrite the pidfile each time main_loop is called. PR: 284282 Reported by: asomers Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48768 --- usr.sbin/ctld/ctld.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 06307d6cdd9a..3b48d33b5966 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -2381,7 +2381,7 @@ handle_connection(struct portal *portal, int fd, } static void -main_loop(struct conf *conf, bool dont_fork) +main_loop(bool dont_fork) { struct kevent kev; struct portal *portal; @@ -2393,8 +2393,6 @@ main_loop(struct conf *conf, bool dont_fork) #endif int error, client_fd; - pidfile_write(conf->conf_pidfh); - for (;;) { if (sighup_received || sigterm_received || timed_out()) return; @@ -2762,12 +2760,14 @@ main(int argc, char **argv) conf_delete(oldconf); oldconf = NULL; + pidfile_write(newconf->conf_pidfh); + /* Schedule iSNS update */ if (!TAILQ_EMPTY(&newconf->conf_isns)) set_timeout((newconf->conf_isns_period + 2) / 3, false); for (;;) { - main_loop(newconf, dont_daemonize); + main_loop(dont_daemonize); if (sighup_received) { sighup_received = false; log_debugx("received SIGHUP, reloading configuration");