From nobody Fri May 23 08:45:18 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 4b3dyk47Vjz5wyR4; Fri, 23 May 2025 08:45:18 +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 4b3dyk3ZKCz3KcN; Fri, 23 May 2025 08:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747989918; 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=0wWA6j8yr7CebURdZUmf3g1FKE1hmKbNtFNbPJ+JroU=; b=QUuhlx+X3OzHCyyNT1bRtKMkPkn+oJSrT0YA9GTRtYmhfyt7qmAkp3EZmC1bgZjw0af6eZ egeReW8ZSxEb24gBL3w0n1UEUrBe+mDVFxC9hN8vVHjPAHrDHcgt05EVXYIBr6UOKGo55d zujZFXRchwR/Y8pKx4PnZTL4nofkjDNaW0LCvlhactU/f6/cvN5L9R0TJc4hkVFPwKjpj3 WmQ6McOXwpK2FJsJuPo6VUBjXUCJ7dUM3xWw/EOsmyYRfoO3PFi9gQzCbpLr9sPUDN+r+V jUVTeurEiIfkbwnIyZPKr0Rh7dqssjETzLNiFHNPMHhD6WMTwPCjesXzwh9TTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747989918; 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=0wWA6j8yr7CebURdZUmf3g1FKE1hmKbNtFNbPJ+JroU=; b=ZR6ucrvatj+SQFjn3hT6qDxNngvr95QMv3P0B9Le+XApS0vb47naRx4bvYWYzRKgxc87aj IrIFdNgO0MUjX5qdZk5LBV8GRXL7qVGgJjpho6E6PAj5Za4KhILNLP/tzfSjz0IdPflxMG FCr0gVRncevUvhMotwb6bERR+AWz3LGuAdHUZpZIB984awn48iTopCIpxVKR+CFhgL8EZc Ukq5WHF51Dtgu3IyPJzTV4S2vF/PktQlB4WRtli2wVzHzwhTnWHbIiyKFqCZ4f1IS+ZXFA Vk1ImQjp+Yuw51sejFrHqYHpMWA8KTV3tgg2jtkDULi+FK8mz3RaUIIrZTaF3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747989918; a=rsa-sha256; cv=none; b=H+/G6/nfH5LL9MrQJZYvlAGd9y7rCj/Q4L1WXRct8hTBTEr+2qKjQ8Rrb8+yYeRkh+EQUy 6dWBFvCnrqXNptSf1A20lWTcRhGh3v23U9yzl6SRlqBQMGjOv2UTcfT64CMKhQHIqi3mjN I11HZsg+8zKntA/5auRQoeD4J21tIVcTEVDGDcBxc606lXJ3FJS6QUyuGEyA9ki4dGhEtQ kwzjZg4iENhMFWWbffZr3wtSKIHzlSjCkwzxpkOLuLC9KrS/18vjcz9tErlh/MJBnqSeCr Mb1wL1YAqWQquc7SUo7RL+g0GkRlUx8WTa5x01Jct4oHU31kPSg0R3CsHYgd7w== 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 4b3dyk2KvRzyLy; Fri, 23 May 2025 08:45:18 +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 54N8jIX8058249; Fri, 23 May 2025 08:45:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54N8jIJG058246; Fri, 23 May 2025 08:45:18 GMT (envelope-from git) Date: Fri, 23 May 2025 08:45:18 GMT Message-Id: <202505230845.54N8jIJG058246@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: 50cf49f6011f - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 50cf49f6011f861c1824303e26fff1655fc3e54a Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=50cf49f6011f861c1824303e26fff1655fc3e54a commit 50cf49f6011f861c1824303e26fff1655fc3e54a Author: sd@mostnet.ru AuthorDate: 2025-05-09 14:48:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-05-23 08:43: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 c367f3bc12a6..51a5ec665cbd 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 November 9, 2021 +.Dd May 9, 2025 .Dt SERVICE 8 .Os .Sh NAME @@ -47,7 +47,7 @@ .Op Fl j Ar jail .Op Fl v .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 ca08e08ecd62..63f8eb006ad6 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -151,7 +151,7 @@ if [ -n "$RCORDER" ]; then exit 0 fi -if [ $# -gt 1 ]; then +if [ $# -gt 0 ]; then script=$1 shift else