From nobody Fri May 23 08:42:23 2025 X-Original-To: dev-commits-src-all@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 4b3dvN4qVQz5wxqN; Fri, 23 May 2025 08:42:24 +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 4b3dvM51FXz3J8s; Fri, 23 May 2025 08:42:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747989743; 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=Y95zPBLgL85Pm+jU7j8Fz5Kc3geVX8md/iKtFCWAXgE=; b=TrXbDiYTv8N9MgCeszh4r6U8/PzEBm0ZkZi1Uumuao1H53Ccc4bACIyLxrQ7jYckpVvPAx BFJpSsoStGqcY76m4MLLIq1fIYHvoFx1AKGz8dwq0rvI7gM3CNwSYiBAnKkYOE4J3Zvvtd cB0MtAlAEUDktkLKXmx3s8SHjVoQ/TcAKHv+KhrkmWwH/2RQol+6q4bjS0Fmf8VzdS4cDB ydOHv64yrLFm/RjWn/dViXzRvgElV7Aj6iQeX2zuGbfWm5g23JS+S9zbxfEqLjecyG/oXv CMrf+ClAzEsx/dj02igg48m0YNJ3JB9eprqZsp6Yy/2uUTq7EC8Fk1W+NDBJYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747989743; 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=Y95zPBLgL85Pm+jU7j8Fz5Kc3geVX8md/iKtFCWAXgE=; b=acKRCnQnXMbtpkEH9Vw+hWrOVnMC3bGd5RPytyRSCftvA0jYkr/GTFUAdpCsAKQySQog5u HvZtfn1dCD5xgyXMJFt9h4JRHm77x0V5IpJHC/Frq1xZvLgJ4Z75OLSzff57lgchQps6EU UnsCnFXhYo2EMA0ZVJku/+bqtfxJsqOc3X1roqUW35sjNwZOXgBYxIw7m3fQoTv392VyP0 6QctzkEfxSRVOmW+oQSIWm9TFokyve/MurtKnMJFcGpGDOl6TuENQjmZi7Jo6FP6O7Jn9a OruD5UNMuLFd1uRlBIJs/eWhLzbEsnJYT+tPW8/rnfWcpAIxeBnR/GPmN5wGhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747989743; a=rsa-sha256; cv=none; b=Xjx13LnmB38msoSgnOMr1CtUA6gweDkn7YYCbB0vKihg/6ChWFTgAW1sdu82r8mlQ4iubi zVZTrynbSmwrpSLae9ZdkussA/RgBvsZN8kaLChFV7zN1dEA9NpntzFttrFGiBcF2XHtw1 RJDycdQqOJV6mBHyiB0Osi7Y45VXAATrHmio2tI3FwaJozizUdEtGhzLfxMxHFbQQEEW1E gABF6cC8tGKMefE9FhJS+X0Zk/oY1Uhmzzn+tfV8SmSkdG8cnAC4pQ+0pxUhKIWY+y5CDC 8tbq4YDfI1sy7zY2LywuHUNViNmdVl6BsCehLA4EJGZ2XOBFD+ZpVCk4xw6j5Q== 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 4b3dvM4Zw1zylR; Fri, 23 May 2025 08:42:23 +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 54N8gNZ8054651; Fri, 23 May 2025 08:42:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54N8gNCK054648; Fri, 23 May 2025 08:42:23 GMT (envelope-from git) Date: Fri, 23 May 2025 08:42:23 GMT Message-Id: <202505230842.54N8gNCK054648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 4e0a5fd7b608 - stable/14 - service(8): Allow for passing no arguments to the service script List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e0a5fd7b608d823767ad239db68cb961455ba6b Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=4e0a5fd7b608d823767ad239db68cb961455ba6b commit 4e0a5fd7b608d823767ad239db68cb961455ba6b Author: sd@mostnet.ru AuthorDate: 2025-05-09 14:48:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-05-23 08:41:58 +0000 service(8): Allow for passing no arguments to the service script Currently, service(8) requires the user to provide a command to the rc service script. For example, service cron does not even run the cron rc service script but instead shows the usage message of service(8). This patch makes it so running the rc service script with no arguments via service(8) is closer to running the rc service script directly (e.g., /etc/rc.d/cron). Long story short, for most of the rc service scripts this change means that running "service FOO" now shows the usage message of FOO instead of the usage message of service(8). PR: 255115 Reviewed by: bnovkov, christos, imp, lme, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47328 (cherry picked from commit 7ffedfe14ca85aa3474980092a732d4e49309c62) --- usr.sbin/service/service.8 | 4 ++-- usr.sbin/service/service.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index 380fbc8c1269..7528fa04b0f1 100644 --- a/usr.sbin/service/service.8 +++ b/usr.sbin/service/service.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2024 +.Dd May 9, 2025 .Dt SERVICE 8 .Os .Sh NAME @@ -48,7 +48,7 @@ .Op Fl v .Op Fl E Ar var=value .Ar script -.Ar command +.Op Ar command .Sh DESCRIPTION The .Nm diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 245430107277..8b7aa937967b 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -162,7 +162,7 @@ if [ -n "$RCORDER" ]; then exit 0 fi -if [ $# -gt 1 ]; then +if [ $# -gt 0 ]; then script=$1 shift else