From nobody Mon Jan 29 17:49:03 2024 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 4TNwlg3zbqz596ZZ; Mon, 29 Jan 2024 17:49:03 +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 4TNwlg35nmz500J; Mon, 29 Jan 2024 17:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706550543; 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=S4M2vANzIIbelIcrxmncG+efns2ue8G9w0ZX2y6ISKk=; b=BfWyyMBeMH0Hzco9+fMyoooZfCvVG29SjOrnhDSctSVuSbuslCSOMn5IyoFLmHtJ+yYbUp 7RvyCIv9mRmy+4BK5LcsZA7VIOHZV83BkUUwrIdevEE6HwJ5QkOFjOVyGybf02dlgL/Lk5 xokX8n2UVq1SzdgbyDw9XXPlHVzeUgZdKN8VtcTTQGpQYrZ09nRcjfROAsT4KVlQiB2b9p 7HCulWsiGvZYXD4Uul9iXUHvZa8fonSvtUBvKG/kCGmV2Ffr0AxHDSPMWXX6DJlkBiO03j kMySzQ7L1Aon4TdFgWRxASjWIxsR8qFhkU2rJMT4o4CG+g0i2PHdf8HFTuQ8Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706550543; 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=S4M2vANzIIbelIcrxmncG+efns2ue8G9w0ZX2y6ISKk=; b=k6Sj3nJA1H+oyWUSFwwDXVXuF0JueLKVtDGs+SiAI2GqV8CUg7V6geBhFVlNMmXJpRANQz NJsuErYp4ec4wjLOw+WoDhvHsql/A9OSdc/QbeYcmtwp5xwPuYkJRPA9V54sd8WF3lTKi/ uTlz90ihLErN66jXe7e3rFwbKGoRnN+ZUa9RKSZcGKYv3b/oDSw0wiRk2xffygGgV0ZX5i za8eBqDhj3X8EAzmfbM2cE3Yq8/v8DGyVzL/gWxsx1In3V50OV7gu7waur6zChP+EsRlkx o6OxP1mAhjnEuJeSo52YN0FT6btQYp1Rma9UwPTgdGy5r30mY2X8KrLWWSFZuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706550543; a=rsa-sha256; cv=none; b=kRydalkuSdexgAxs1qFA0qqqVb823qX7CedjRB32K9IDig6+QYQW7c1bEX1mWmqvUUXO1N uxZ0v1RjcpLpAeZkMyIip7SfY3koxAF09oWEyMSHLwO4SEMW0pdzRabcQDpBCN273hD357 afReGz6FExcFk/kOHxFGsM2bw8V9fXCww5ntkjaCvx62Jk3mtmJwbzHx9k6pu3/p3YU7eF /lF18x6ZqSFsopDX2GeId6vtlw2YN5z1cPHxv52fFuJHeGQFrzHiu2gfO4bWTqytPyF3US Fl28yBkJv0l5XltjWFIhOCpyBwUvI7wmPVXtHhcoPzXny0UgmxcBF4o4eFdw0A== 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 4TNwlg29x6z117k; Mon, 29 Jan 2024 17:49:03 +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 40THn3uQ022651; Mon, 29 Jan 2024 17:49:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40THn3V0022648; Mon, 29 Jan 2024 17:49:03 GMT (envelope-from git) Date: Mon, 29 Jan 2024 17:49:03 GMT Message-Id: <202401291749.40THn3V0022648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: a84e01f02b15 - main - service(8): direct user to rc(8) for a list of valid commands 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a84e01f02b15dc1ec091feab6e532d5ba36ffbbb Auto-Submitted: auto-generated The branch main has been updated by debdrup: URL: https://cgit.FreeBSD.org/src/commit/?id=a84e01f02b15dc1ec091feab6e532d5ba36ffbbb commit a84e01f02b15dc1ec091feab6e532d5ba36ffbbb Author: Lexi Winter AuthorDate: 2024-01-13 23:34:46 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2024-01-29 17:47:09 +0000 service(8): direct user to rc(8) for a list of valid commands New users may refer to service(8) to discover how to manage services, but this manpage does not explain which commands are permitted besides start/stop (for example, 'enable'). Add a paragraph that directs the reader to rc(8) to discover this. While here, add a few examples of common use-cases. Reported by: Mina Galić Pull request: https://github.com/freebsd/freebsd-src/pull/1057 --- usr.sbin/service/service.8 | 51 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index ada0e6361fb8..2c5dfa3f3a66 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 January 29, 2024 .Dt SERVICE 8 .Os .Sh NAME @@ -64,6 +64,13 @@ see It can also be used to list the scripts using various criteria. .Pp +The set of permissible values for +.Ar command +depends on the particular rc.d script being invoked. +For a list of standard commands which are supported by most rc.d +scripts, see +.Xr rc 8 . +.Pp The options are as follows: .Bl -tag -width F1 .It Fl E Ar var=value @@ -129,13 +136,44 @@ option is used, the corresponding variable is set accordingly. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -The following are examples of typical usage of the -.Nm -command: +These are some examples of the most common service commands. +For a full list of commands available in most rc.d scripts, see +.Xr rc 8 . +.Pp +Enable a service, then start it: +.Bd -literal -offset -indent +service sshd enable +service sshd start +.Ed +.Pp +Stop a service, then disable it: +.Bd -literal -offset -indent +service sshd stop +service sshd disable +.Ed +.Pp +Start a service which is not enabled: +.Bd -literal -offset -indent +service sshd onestart +.Ed +.Pp +Report the status of a service: .Bd -literal -offset -ident service named status -service -j dns named status +.Ed +.Pp +Restart a service running in a jail: +.Bd -literal -offset -indent +service -j dns named restart +.Ed +.Pp +Start a service with a specific environment variable set: +.Bd -literal -offset -indent service -E LC_ALL=C.UTF-8 named start +.Ed +.Pp +Report a verbose listing of all available services: +.Bd -literal -offset -indent service -rv .Ed .Pp @@ -164,7 +202,8 @@ complete -F _service service .Xr bash 1 Pq Pa ports/shells/bash , .Xr rc.conf 5 , .Xr rc 8 , -.Xr rcorder 8 +.Xr rcorder 8 , +.Xr sysrc 8 .Sh HISTORY The .Nm