From nobody Mon Nov 04 15:56:39 2024 X-Original-To: dev-commits-src-branches@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 4Xhx0m2YmVz5cFfF; Mon, 04 Nov 2024 15:56:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xhx0m0V8tz4kSw; Mon, 4 Nov 2024 15:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730735800; 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=r2R4YmHH2TVELzgAbmbkwEV28sHOVJto47JRyYBmAyk=; b=OCPwfELJGdYEVyeTyhXyOLlh2TPkNQYwzYd36p6qeTANrWwb+grqWJjcDVTDY0AIEhprvL G7ZLhdzQYGVQXAqIZ8AwdvkHUGLO3aKm2ze16NERmABeJJhlo4LQIFwzEdG/Q4giJHh+tK EN2EXhK2yT4nGDYsIn/zKZUHIpCnNSjY3Zg7TAhklmKFVrZg9gcXs4w/ltLz38Xt16eaDf aAdDYO3Hc+rc3mFTBh3KfIHzjWLpldtz1PI7csTCMmkkIuhach+rslmK1rGYP4PEPUCDgq 1VrBpC+H4CTbDPGX2hKBqIm7bz1se8Mzfc+DjqajLukYQUDfLXbo4f7X4/zxPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730735800; 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=r2R4YmHH2TVELzgAbmbkwEV28sHOVJto47JRyYBmAyk=; b=ldzv9AUvm0BIj+QsO4XsI6JW/l9mueIDkkEvlmvEccHxiAkEhUBTlXNOQVTU7ruAY7PoNP aGdnKClJCeAcvJNkDliVuKweqNHxWMSnvkwXbny8TIjirc2pN/mcSNrG4c/UpdW/866u9T JpVPg4FDGJiBuynwR2tcaYhpjsJmVUPBVTUt06su6jJoTcT2s4HBLR113oDFpzUvPK2FUR VAaN3JuplT49G+SxaHQEMoIQc0F9SWv0byJ2y6WhPh5bGVeKCAXLoe7AAwZjEnZ/8CU+30 Qw9DYDhYlIVfiT+gCWJbfZNfSFTb62g1bpqeSRsyLVaKorvWMxAb7QwLxqvNkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730735800; a=rsa-sha256; cv=none; b=EK7nQC7tiubCbT982fyItK0Zs6DR6N/oPTHG9O/iz8hgFdk7EgNxx+AD4+qinsxRBdDMXV eyXKknhsd12LdkvIqwVqTIkcv7mYLtUfrTy6bOki0a+EaF5qk+KVEadZGVduHBhx1O7R/S Aaqozia8EUicLSV5yLybJzt2MaT1bwpgIWOEmF6Fx+HyKAhXX6DuTwJG4kZujFnSCptDrQ gKAP2ukPpeKRJ/LV1L5gTh9oNH42A3JjPwDdEVJduvCBCvUeYAVmDyEHyeAvazxcBGcwX6 MOi4ni+Upj5GJDOs4CsvYA6P2LkpQDIC1qt6K20nnNQM4j3/ArredjZVGKnPZQ== 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 4Xhx0m04QMzfx2; Mon, 4 Nov 2024 15:56:40 +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 4A4Fuddi072182; Mon, 4 Nov 2024 15:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4Fudio072179; Mon, 4 Nov 2024 15:56:39 GMT (envelope-from git) Date: Mon, 4 Nov 2024 15:56:39 GMT Message-Id: <202411041556.4A4Fudio072179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 34b80cbdafc8 - stable/14 - service(8): direct user to rc(8) for a list of valid commands List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 34b80cbdafc8a23243ff50c9c49fe30e4336001e Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=34b80cbdafc8a23243ff50c9c49fe30e4336001e commit 34b80cbdafc8a23243ff50c9c49fe30e4336001e Author: Lexi Winter AuthorDate: 2024-01-13 23:34:46 +0000 Commit: Mitchell Horne CommitDate: 2024-11-04 15:56:24 +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 (cherry picked from commit a84e01f02b15dc1ec091feab6e532d5ba36ffbbb) --- 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