From nobody Sun Sep 17 06:51:15 2023 X-Original-To: dev-commits-ports-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 4RpJVX3TrKz4sbHW; Sun, 17 Sep 2023 06:51:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RpJVX28Q7z3SjC; Sun, 17 Sep 2023 06:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694933476; 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=L+Ver3/80XFmeWGvfEjori54+49caWkBcaBGI4KCXEo=; b=Flwt/wKGMZPrazH+47hL8S34wKQ+ZJg74Qc3PZ8/sfTLM08jzkt7HOvGXoE84aKS8Yzc6g fB1bLZUJk8oOfUpMLAKE2X3emGqv4QxIyjJNEKczZipB14Ds3+WLjM+GGh4nCQ076vJ6MO A9k9sgu6648JB4E0LByjQ3U/N1nq3WGIPi5zjGo7bpJBn3bWQeYB9Vftqb8kyB4xfUMTla xnsTUa9Pp2zKopuGUJIv36C4u3y3E7XLDOEzVeP1dfF10Vkhw4NDPSghJIGFObYTuemDXS /w8aotgdLeEcUefOT/tqN5SytkxDJmOluB8vmdaJgk1Fb5gU9UWshm8fSFWSLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694933476; a=rsa-sha256; cv=none; b=miVhVB456/NulnLST0RoxuF3vMGu0SsDff2GUcHNk+8zuSjwHXnCiYL7TQNcpuqznzeGF5 CvilqKIYOhHWTDEj5u2tCziMP+3dOJlUcW7G1JSB57LjSKPryKYMHBQ+0ezWJWCirXNLKA 4Dw1ugG/iurjhQPrGnTjtT3tiVby1XEoA7VsX04J9iIJt9WYispNRF9olR0JFuHmmuFr0R vuDopXKAX4px5sfTDhMRjUWEsbOqgHFEQvKLAUPYQ4bTVrZ7soPMgO6vMtr7NKkSp1ps/I 3YhS63zaiR+QvlrG3q7IumtD12W8zqrZiuZFRGiCforWUUs2ZTJU+5OZ2nl8sA== 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=1694933476; 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=L+Ver3/80XFmeWGvfEjori54+49caWkBcaBGI4KCXEo=; b=HYN3CPE71n1Nxh2M9usBYxwP20UpyO36+C14P0YBcsyyK0FN28FVKayIxntclZDi3Xons+ D6Bntv6Uq2gtTKbkpN41LhKtj2T+ZxR8IH9zewQcaalavoXp5+BS3h0ziCpzJukf7FTonp bwuMYMWbVNeJp/vZ8FA7IxVi/BG3a0ecljw49Ml8ufmx2YqhLj63NG+7UdBnuvTMcX/ZF+ +KzXgL0NO1s4KWtkl5FRoMP17P04dOSVRiMm0GKWvzh0iUBWoFD/XAyAGUrPo59KYP0V22 MPLe9bk182HPfBaAiLlpq7EcYo166pXDRy8wbRZfvJ+UpF3V3jvtZgxSVIv+Wg== 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 4RpJVX0Bm1zf1v; Sun, 17 Sep 2023 06:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38H6pF8G055991; Sun, 17 Sep 2023 06:51:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38H6pF5g055988; Sun, 17 Sep 2023 06:51:15 GMT (envelope-from git) Date: Sun, 17 Sep 2023 06:51:15 GMT Message-Id: <202309170651.38H6pF5g055988@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Chris Rees Subject: git: a3a0138c361a - main - sysutils/runit: Fix shutdown and reboot List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3a0138c361a100177bca61ddd1d545d5402a674 Auto-Submitted: auto-generated The branch main has been updated by crees: URL: https://cgit.FreeBSD.org/ports/commit/?id=a3a0138c361a100177bca61ddd1d545d5402a674 commit a3a0138c361a100177bca61ddd1d545d5402a674 Author: Chris Rees AuthorDate: 2023-09-06 19:30:58 +0000 Commit: Chris Rees CommitDate: 2023-09-17 06:50:43 +0000 sysutils/runit: Fix shutdown and reboot The FreeBSD PREFIX insistence plays havoc with runit, but this should fix the issues on rebooting and shutting down when using runit-init. The problem was because of the inconsistency of where stopit and reboot are stored. While here, pet rclint and identify bug in rclint at the same time! --- sysutils/runit/Makefile | 9 +++++---- sysutils/runit/files/patch-etc_freebsd_1 | 19 +++++++++++++++++++ sysutils/runit/files/patch-etc_freebsd_3 | 18 ++++++++++++++++++ sysutils/runit/files/patch-src_runit.h | 12 ++++++++++++ sysutils/runit/files/runsvdir.in | 14 +++++++------- 5 files changed, 61 insertions(+), 11 deletions(-) diff --git a/sysutils/runit/Makefile b/sysutils/runit/Makefile index b98867ef8ba4..44cf1846c437 100644 --- a/sysutils/runit/Makefile +++ b/sysutils/runit/Makefile @@ -1,6 +1,6 @@ PORTNAME= runit PORTVERSION= 2.1.2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils MASTER_SITES= http://smarden.org/${PORTNAME}/ \ http://www.bayofrum.net/dist/${PORTNAME}/ @@ -36,14 +36,15 @@ OPTIONS_DEFINE= DOCS post-patch: ${REINPLACE_CMD} -i '' 's!/service/!${SERVICE_DIR}!' \ ${PATCH_WRKSRC}/man/* ${PATCH_WRKSRC}/src/sv.c - ${REINPLACE_CMD} -i '' '\|^PATH=|s|$$|:${PREFIX}/bin:${PREFIX}/sbin|' \ - ${PATCH_WRKSRC}/etc/freebsd/3 ${FIND} ${PATCH_WRKSRC} -name '*.orig' -delete do-configure: ${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/src/conf-cc ${ECHO_CMD} "${CC}" > ${WRKSRC}/src/conf-ld - ${ECHO_CMD} '#define PREFIX "${PREFIX}"' >> ${WRKSRC}/src/runit.h + ${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' \ + ${WRKSRC}/src/runit.h \ + ${WRKSRC}/etc/freebsd/1 \ + ${WRKSRC}/etc/freebsd/3 do-build: cd ${WRKSRC} && package/compile && package/check diff --git a/sysutils/runit/files/patch-etc_freebsd_1 b/sysutils/runit/files/patch-etc_freebsd_1 new file mode 100644 index 000000000000..867c2e3aae90 --- /dev/null +++ b/sysutils/runit/files/patch-etc_freebsd_1 @@ -0,0 +1,19 @@ +--- etc/freebsd/1.orig 2023-06-06 12:43:28 UTC ++++ etc/freebsd/1 +@@ -1,7 +1,7 @@ + #!/bin/sh + # system one time tasks + +-PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin ++PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/sbin:%%PREFIX%%/bin + trap : 2 + trap : 3 + +@@ -13,5 +13,5 @@ if test $? -ne 0; then + sh -p + exec reboot + fi +-touch /etc/runit/stopit +-chmod 0 /etc/runit/stopit ++touch /etc/runit/stopit /etc/runit/reboot ++chmod 0 /etc/runit/stopit /etc/runit/reboot diff --git a/sysutils/runit/files/patch-etc_freebsd_3 b/sysutils/runit/files/patch-etc_freebsd_3 new file mode 100644 index 000000000000..0a4b61724d01 --- /dev/null +++ b/sysutils/runit/files/patch-etc_freebsd_3 @@ -0,0 +1,18 @@ +--- etc/freebsd/3.orig 2023-06-06 12:50:59 UTC ++++ etc/freebsd/3 +@@ -1,7 +1,7 @@ + #!/bin/sh + exec 2>&1 + +-PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin ++PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/sbin:%%PREFIX%%/bin + + echo 'Waiting for services to stop...' + sv -w196 force-stop /service/* +@@ -11,5 +11,5 @@ echo 'Shutdown...' + if test -x /etc/runit/reboot; then + exec reboot + else +- exec halt ++ exec halt -p + fi diff --git a/sysutils/runit/files/patch-src_runit.h b/sysutils/runit/files/patch-src_runit.h new file mode 100644 index 000000000000..6a2ab2c91f94 --- /dev/null +++ b/sysutils/runit/files/patch-src_runit.h @@ -0,0 +1,12 @@ +--- src/runit.h.orig 2023-06-06 12:35:21 UTC ++++ src/runit.h +@@ -1,4 +1,5 @@ +-#define RUNIT "/sbin/runit" +-#define STOPIT "/etc/runit/stopit" +-#define REBOOT "/etc/runit/reboot" +-#define CTRLALTDEL "/etc/runit/ctrlaltdel" ++#define PREFIX "%%PREFIX%%" ++#define RUNIT PREFIX "/sbin/runit" ++#define STOPIT PREFIX "/etc/runit/stopit" ++#define REBOOT PREFIX "/etc/runit/reboot" ++#define CTRLALTDEL PREFIX "/etc/runit/ctrlaltdel" diff --git a/sysutils/runit/files/runsvdir.in b/sysutils/runit/files/runsvdir.in index 64cf7610f820..0bddc293b01e 100644 --- a/sysutils/runit/files/runsvdir.in +++ b/sysutils/runit/files/runsvdir.in @@ -1,21 +1,21 @@ #!/bin/sh - -# PROVIDE: /service +# +# PROVIDE: runsvdir # BEFORE: SERVERS # KEYWORD: shutdown - -# Add the following lines to /etc/rc.conf to enable `runsvdir': # -#runsvdir_enable="YES" (default: NO) -#runsvdir_path="/service" (default: %%SERVICE_DIR%%) +# Add the following lines to /etc/rc.conf to enable `runsvdir': # +# runsvdir_enable="YES" (default: NO) +# runsvdir_path="/var/service" (default: %%SERVICE_DIR%%) . /etc/rc.subr name=runsvdir rcvar=runsvdir_enable +desc="Runit service supervision" -load_rc_config runsvdir +load_rc_config $name : ${runsvdir_enable:=NO} : ${runsvdir_path=%%SERVICE_DIR%%}