From: ajacoutot Date: Sat, 21 May 2022 14:11:39 +0000 (+0000) Subject: Document rc_exec. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3e5e1dd6bbb7b39243ac901773c1c309448dc8f7;p=openbsd Document rc_exec. --- diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8 index 522d5aec2ed..51fe5de956d 100644 --- a/share/man/man8/rc.subr.8 +++ b/share/man/man8/rc.subr.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rc.subr.8,v 1.42 2021/12/30 08:14:29 ajacoutot Exp $ +.\" $OpenBSD: rc.subr.8,v 1.43 2022/05/21 14:11:39 ajacoutot Exp $ .\" .\" Copyright (c) 2021 Antoine Jacoutot .\" Copyright (c) 2011 Robert Nagy, Antoine Jacoutot, Ingo Schwarze @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 30 2021 $ +.Dd $Mdocdate: May 21 2022 $ .Dt RC.SUBR 8 .Os .Sh NAME @@ -101,6 +101,12 @@ function as The following shell functions are defined by .Nm : .Bl -tag -width rc_reload +.It Ic rc_check +Search for processes of the service with +.Xr pgrep 1 +using the regular expression given in the +.Va pexp +variable. .It Ic rc_cmd Ar action Run the .Ar action @@ -182,17 +188,33 @@ If it is running, call .Ic rc_reload . .El -.It Ic rc_check -Search for processes of the service with -.Xr pgrep 1 -using the regular expression given in the +.It Ic rc_exec +Execute process using +.Xr su 1 +according to +.Va daemon_class , +.Va daemon_user , +.Va daemon_rtable +and +.Va daemon_logger +values. +.It Ic rc_reload +Send the +.Va rc_reload_signal +using +.Xr pkill 1 +on the regular expression given in the .Va pexp variable. +One has to make sure that sending +.Dv SIGHUP +to a daemon will have the desired effect, +i.e. that it will reload its configuration. .It Ic rc_start Start the daemon. Defaults to: .Bd -literal -offset indent -${rcexec} "${daemon} ${daemon_flags}" +rc_exec "${daemon} ${daemon_flags}" .Ed .It Ic rc_stop Stop the daemon. @@ -203,18 +225,6 @@ using on the regular expression given in the .Va pexp variable. -.It Ic rc_reload -Send the -.Va rc_reload_signal -using -.Xr pkill 1 -on the regular expression given in the -.Va pexp -variable. -One has to make sure that sending -.Dv SIGHUP -to a daemon will have the desired effect, -i.e. that it will reload its configuration. .El .Sh ENVIRONMENT .Ic rc_cmd @@ -327,22 +337,6 @@ in an script, if the .Cm check action needs root privileges. -.It Va rcexec -Holds the full -.Xr su 1 -command used to run the daemon. -Defaults to: -.Pp -.Dl "su -fl -c ${daemon_class} -s /bin/sh ${daemon_user} -c" -.El -If the routing table of the current process differs from -.Va daemon_rtable -the following -.Xr route 8 -command is prepended to -.Va rcexec : -.Pp -.Dl "route -T ${daemon_rtable} exec" .Pp All .Va daemon_* @@ -381,6 +375,7 @@ and .Va daemon_user will override those defaults. .El +.El .Sh FILES .Bl -tag -width Ds .It Pa /etc/rc.d/