14f779fd6SMike Makonnen.\" $NetBSD: rc.subr.8,v 1.12 2004/01/06 00:52:24 lukem Exp $ 254e347fbSGordon Tetlow.\" 34f779fd6SMike Makonnen.\" Copyright (c) 2002-2004 The NetBSD Foundation, Inc. 454e347fbSGordon Tetlow.\" All rights reserved. 554e347fbSGordon Tetlow.\" 654e347fbSGordon Tetlow.\" This code is derived from software contributed to The NetBSD Foundation 754e347fbSGordon Tetlow.\" by Luke Mewburn. 854e347fbSGordon Tetlow.\" 954e347fbSGordon Tetlow.\" Redistribution and use in source and binary forms, with or without 1054e347fbSGordon Tetlow.\" modification, are permitted provided that the following conditions 1154e347fbSGordon Tetlow.\" are met: 1254e347fbSGordon Tetlow.\" 1. Redistributions of source code must retain the above copyright 1354e347fbSGordon Tetlow.\" notice, this list of conditions and the following disclaimer. 1454e347fbSGordon Tetlow.\" 2. Redistributions in binary form must reproduce the above copyright 1554e347fbSGordon Tetlow.\" notice, this list of conditions and the following disclaimer in the 1654e347fbSGordon Tetlow.\" documentation and/or other materials provided with the distribution. 1754e347fbSGordon Tetlow.\" 1854e347fbSGordon Tetlow.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1954e347fbSGordon Tetlow.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2054e347fbSGordon Tetlow.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2154e347fbSGordon Tetlow.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2254e347fbSGordon Tetlow.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2354e347fbSGordon Tetlow.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2454e347fbSGordon Tetlow.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2554e347fbSGordon Tetlow.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2654e347fbSGordon Tetlow.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2754e347fbSGordon Tetlow.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2854e347fbSGordon Tetlow.\" POSSIBILITY OF SUCH DAMAGE. 2954e347fbSGordon Tetlow.\" 30*a5ad360fSMateusz Piotrowski.Dd October 23, 2024 3154e347fbSGordon Tetlow.Dt RC.SUBR 8 3254e347fbSGordon Tetlow.Os 3354e347fbSGordon Tetlow.Sh NAME 3454e347fbSGordon Tetlow.Nm rc.subr 3554e347fbSGordon Tetlow.Nd functions used by system shell scripts 3654e347fbSGordon Tetlow.Sh SYNOPSIS 37eec3e03eSRuslan Ermilov.Bl -item -compact 3854e347fbSGordon Tetlow.It 39eec3e03eSRuslan Ermilov.Ic .\& Pa /etc/rc.subr 40eec3e03eSRuslan Ermilov.Pp 4154e347fbSGordon Tetlow.It 4254e347fbSGordon Tetlow.Ic backup_file Ar action Ar file Ar current Ar backup 4354e347fbSGordon Tetlow.It 4454e347fbSGordon Tetlow.Ic checkyesno Ar var 4554e347fbSGordon Tetlow.It 4654e347fbSGordon Tetlow.Ic check_pidfile Ar pidfile Ar procname Op Ar interpreter 4754e347fbSGordon Tetlow.It 4854e347fbSGordon Tetlow.Ic check_process Ar procname Op Ar interpreter 4954e347fbSGordon Tetlow.It 50aa3b7a2fSSimon J. Gerraty.Ic DebugOn Ar tag ... 51aa3b7a2fSSimon J. Gerraty.It 52aa3b7a2fSSimon J. Gerraty.Ic DebugOff Ar tag ... 53aa3b7a2fSSimon J. Gerraty.It 5454e347fbSGordon Tetlow.Ic debug Ar message 5554e347fbSGordon Tetlow.It 56aa3b7a2fSSimon J. Gerraty.Ic dot Ar file ... 57aa3b7a2fSSimon J. Gerraty.It 5854e347fbSGordon Tetlow.Ic err Ar exitval Ar message 5954e347fbSGordon Tetlow.It 6054e347fbSGordon Tetlow.Ic force_depend Ar name 6154e347fbSGordon Tetlow.It 6254e347fbSGordon Tetlow.Ic info Ar message 6354e347fbSGordon Tetlow.It 64aa3b7a2fSSimon J. Gerraty.Ic is_verified Ar file 65aa3b7a2fSSimon J. Gerraty.It 661679c7f4SYaroslav Tykhiy.Ic load_kld Oo Fl e Ar regex Oc Oo Fl m Ar module Oc Ar file 671679c7f4SYaroslav Tykhiy.It 68aa3b7a2fSSimon J. Gerraty.Ic load_rc_config Oo Ar flag Oc Op Ar service 6954e347fbSGordon Tetlow.It 708d2e10d0SFlorent Thoumie.Ic load_rc_config_var Ar name Ar var 7146587ab8SFlorent Thoumie.It 7254e347fbSGordon Tetlow.Ic mount_critical_filesystems Ar type 7354e347fbSGordon Tetlow.It 74aa3b7a2fSSimon J. Gerraty.Ic rc_log Ar message 75aa3b7a2fSSimon J. Gerraty.It 768b92fa1cSGraham Percival.Ic rc_trace Ar level Ar message 77aa3b7a2fSSimon J. Gerraty.It 78eec3e03eSRuslan Ermilov.Ic rc_usage Ar command ... 7954e347fbSGordon Tetlow.It 80eec3e03eSRuslan Ermilov.Ic reverse_list Ar item ... 8154e347fbSGordon Tetlow.It 8254e347fbSGordon Tetlow.Ic run_rc_command Ar argument 8354e347fbSGordon Tetlow.It 8454e347fbSGordon Tetlow.Ic run_rc_script Ar file Ar argument 8554e347fbSGordon Tetlow.It 86aa3b7a2fSSimon J. Gerraty.Ic run_rc_scripts Oo options Oc Ar file ... 87aa3b7a2fSSimon J. Gerraty.It 88aa3b7a2fSSimon J. Gerraty.Ic safe_dot Ar file ... 89aa3b7a2fSSimon J. Gerraty.It 90aa3b7a2fSSimon J. Gerraty.Ic sdot Ar file ... 91aa3b7a2fSSimon J. Gerraty.It 92325ebf37SJose Luis Duran.Ic startmsg Oo Fl n Oc Ar message 93325ebf37SJose Luis Duran.It 94aa3b7a2fSSimon J. Gerraty.Ic vdot Ar file ... 95aa3b7a2fSSimon J. Gerraty.It 96eec3e03eSRuslan Ermilov.Ic wait_for_pids Op Ar pid ... 9754e347fbSGordon Tetlow.It 9854e347fbSGordon Tetlow.Ic warn Ar message 9954e347fbSGordon Tetlow.El 10054e347fbSGordon Tetlow.Sh DESCRIPTION 101eec3e03eSRuslan ErmilovThe 10254e347fbSGordon Tetlow.Nm 103eec3e03eSRuslan Ermilovscript 10454e347fbSGordon Tetlowcontains commonly used shell script functions and variable 10554e347fbSGordon Tetlowdefinitions which are used by various scripts such as 10654e347fbSGordon Tetlow.Xr rc 8 . 10754e347fbSGordon TetlowScripts required by ports in 10854e347fbSGordon Tetlow.Pa /usr/local/etc/rc.d 10954e347fbSGordon Tetlowwill also eventually 11054e347fbSGordon Tetlowbe rewritten to make use of it. 11154e347fbSGordon Tetlow.Pp 11254e347fbSGordon TetlowThe 11354e347fbSGordon Tetlow.Nm 11454e347fbSGordon Tetlowfunctions were mostly imported from 11557984250SEd Maste.Nx . 11654e347fbSGordon Tetlow.Pp 11757984250SEd MasteThey are accessed by sourcing 11854e347fbSGordon Tetlow.Pa /etc/rc.subr 11954e347fbSGordon Tetlowinto the current shell. 12054e347fbSGordon Tetlow.Pp 12154e347fbSGordon TetlowThe following shell functions are available: 12254e347fbSGordon Tetlow.Bl -tag -width 4n 123eec3e03eSRuslan Ermilov.It Ic backup_file Ar action file current backup 12454e347fbSGordon TetlowMake a backup copy of 12554e347fbSGordon Tetlow.Ar file 12654e347fbSGordon Tetlowinto 12754e347fbSGordon Tetlow.Ar current . 1285b71d899SBaptiste DaroussinSave the previous version of 12954e347fbSGordon Tetlow.Ar current 13054e347fbSGordon Tetlowas 13154e347fbSGordon Tetlow.Ar backup . 13254e347fbSGordon Tetlow.Pp 133eec3e03eSRuslan ErmilovThe 13454e347fbSGordon Tetlow.Ar action 135eec3e03eSRuslan Ermilovargument 13654e347fbSGordon Tetlowmay be one of the following: 13785986815SMateusz Piotrowski.Bl -tag -width "remove" 138eec3e03eSRuslan Ermilov.It Cm add 13954e347fbSGordon Tetlow.Ar file 14054e347fbSGordon Tetlowis now being backed up by or possibly re-entered into this backup mechanism. 14154e347fbSGordon Tetlow.Ar current 1425b71d899SBaptiste Daroussinis created. 143eec3e03eSRuslan Ermilov.It Cm update 14454e347fbSGordon Tetlow.Ar file 14554e347fbSGordon Tetlowhas changed and needs to be backed up. 14654e347fbSGordon TetlowIf 14754e347fbSGordon Tetlow.Ar current 14854e347fbSGordon Tetlowexists, it is copied to 14954e347fbSGordon Tetlow.Ar backup 15054e347fbSGordon Tetlowand then 15154e347fbSGordon Tetlow.Ar file 15254e347fbSGordon Tetlowis copied to 15354e347fbSGordon Tetlow.Ar current . 154eec3e03eSRuslan Ermilov.It Cm remove 15554e347fbSGordon Tetlow.Ar file 15654e347fbSGordon Tetlowis no longer being tracked by this backup mechanism. 15754e347fbSGordon Tetlow.Ar current 15854e347fbSGordon Tetlowis moved to 15954e347fbSGordon Tetlow.Ar backup . 16054e347fbSGordon Tetlow.El 16154e347fbSGordon Tetlow.It Ic checkyesno Ar var 16254e347fbSGordon TetlowReturn 0 if 16354e347fbSGordon Tetlow.Ar var 16454e347fbSGordon Tetlowis defined to 165eec3e03eSRuslan Ermilov.Dq Li YES , 166eec3e03eSRuslan Ermilov.Dq Li TRUE , 167eec3e03eSRuslan Ermilov.Dq Li ON , 16854e347fbSGordon Tetlowor 169eec3e03eSRuslan Ermilov.Ql 1 . 17054e347fbSGordon TetlowReturn 1 if 17154e347fbSGordon Tetlow.Ar var 17254e347fbSGordon Tetlowis defined to 173eec3e03eSRuslan Ermilov.Dq Li NO , 174eec3e03eSRuslan Ermilov.Dq Li FALSE , 175eec3e03eSRuslan Ermilov.Dq Li OFF , 17654e347fbSGordon Tetlowor 177eec3e03eSRuslan Ermilov.Ql 0 . 17854e347fbSGordon TetlowOtherwise, warn that 17954e347fbSGordon Tetlow.Ar var 18054e347fbSGordon Tetlowis not set correctly. 18154e347fbSGordon TetlowThe values are case insensitive. 182fa1dab78SMateusz Piotrowski.Em Note : 1838fe51638SYaroslav Tykhiy.Ar var 1848fe51638SYaroslav Tykhiyshould be a variable name, not its value; 1858fe51638SYaroslav Tykhiy.Ic checkyesno 1868fe51638SYaroslav Tykhiywill expand the variable by itself. 187eec3e03eSRuslan Ermilov.It Ic check_pidfile Ar pidfile procname Op Ar interpreter 18854e347fbSGordon TetlowParses the first word of the first line of 18954e347fbSGordon Tetlow.Ar pidfile 19054e347fbSGordon Tetlowfor a PID, and ensures that the process with that PID 19154e347fbSGordon Tetlowis running and its first argument matches 19254e347fbSGordon Tetlow.Ar procname . 1934f779fd6SMike MakonnenPrints the matching PID if successful, otherwise nothing. 19454e347fbSGordon TetlowIf 19554e347fbSGordon Tetlow.Ar interpreter 19654e347fbSGordon Tetlowis provided, parse the first line of 19754e347fbSGordon Tetlow.Ar procname , 1988d52cc90SYaroslav Tykhiyensure that the line is of the form: 199eec3e03eSRuslan Ermilov.Pp 200eec3e03eSRuslan Ermilov.Dl "#! interpreter [...]" 201eec3e03eSRuslan Ermilov.Pp 20254e347fbSGordon Tetlowand use 20354e347fbSGordon Tetlow.Ar interpreter 20454e347fbSGordon Tetlowwith its optional arguments and 20554e347fbSGordon Tetlow.Ar procname 20654e347fbSGordon Tetlowappended as the process string to search for. 20754e347fbSGordon Tetlow.It Ic check_process Ar procname Op Ar interpreter 20854e347fbSGordon TetlowPrints the PIDs of any processes that are running with a first 20954e347fbSGordon Tetlowargument that matches 21054e347fbSGordon Tetlow.Ar procname . 21154e347fbSGordon Tetlow.Ar interpreter 21254e347fbSGordon Tetlowis handled as per 21354e347fbSGordon Tetlow.Ic check_pidfile . 214aa3b7a2fSSimon J. Gerraty.It Ic DebugOn Ar tag ... 215aa3b7a2fSSimon J. GerratyEnable tracing if not already enabled, 216aa3b7a2fSSimon J. Gerratyand any 217aa3b7a2fSSimon J. Gerraty.Ar tag 218aa3b7a2fSSimon J. Gerratyis found in 219aa3b7a2fSSimon J. Gerraty.Va DEBUG_SH 220aa3b7a2fSSimon J. Gerraty(a comma separated list of tags). 221aa3b7a2fSSimon J. Gerraty.Pp 222aa3b7a2fSSimon J. GerratyRecord the 223aa3b7a2fSSimon J. Gerraty.Ar tag 224aa3b7a2fSSimon J. Gerratythat caused it to be enabled in 225aa3b7a2fSSimon J. Gerraty.Va DEBUG_ON , 226aa3b7a2fSSimon J. Gerratyset 227aa3b7a2fSSimon J. Gerraty.Va DEBUG_DO 228aa3b7a2fSSimon J. Gerratyempty and 229aa3b7a2fSSimon J. Gerraty.Va DEBUG_SKIP 230aa3b7a2fSSimon J. Gerratyto 231aa3b7a2fSSimon J. Gerraty.Ql \&: . 232aa3b7a2fSSimon J. Gerraty.Pp 233aa3b7a2fSSimon J. GerratySee 234aa3b7a2fSSimon J. Gerraty.Xr debug.sh 8 235aa3b7a2fSSimon J. Gerratyfor more details. 236aa3b7a2fSSimon J. Gerraty.It Ic DebugOff Ar tag ... 237aa3b7a2fSSimon J. GerratyDisable tracing if enabled and any 238aa3b7a2fSSimon J. Gerraty.Ar tag 239aa3b7a2fSSimon J. Gerratymatches 240aa3b7a2fSSimon J. Gerraty.Va DEBUG_ON , 241aa3b7a2fSSimon J. Gerratywhich means it was the reason tracing was enabled. 242aa3b7a2fSSimon J. Gerraty.Pp 243aa3b7a2fSSimon J. GerratySet 244aa3b7a2fSSimon J. Gerraty.Va DEBUG_DO 245aa3b7a2fSSimon J. Gerratyto 246aa3b7a2fSSimon J. Gerraty.Ql \&: , 247aa3b7a2fSSimon J. Gerratyand 248aa3b7a2fSSimon J. Gerraty.Va DEBUG_ON , 249aa3b7a2fSSimon J. Gerraty.Va DEBUG_SKIP 250aa3b7a2fSSimon J. Gerratyempty. 25154e347fbSGordon Tetlow.It Ic debug Ar message 25254e347fbSGordon TetlowDisplay a debugging message to 253eec3e03eSRuslan Ermilov.Va stderr , 25454e347fbSGordon Tetlowlog it to the system log using 25554e347fbSGordon Tetlow.Xr logger 1 , 25654e347fbSGordon Tetlowand 25754e347fbSGordon Tetlowreturn to the caller. 25857bd0fc6SJens SchweikhardtThe error message consists of the script name 25954e347fbSGordon Tetlow(from 260eec3e03eSRuslan Ermilov.Va $0 ) , 26154e347fbSGordon Tetlowfollowed by 262eec3e03eSRuslan Ermilov.Dq Li ": DEBUG: " , 26354e347fbSGordon Tetlowand then 26454e347fbSGordon Tetlow.Ar message . 26554e347fbSGordon TetlowThis function is intended to be used by developers 2665203edcdSRuslan Ermilovas an aid to debugging scripts. 2675203edcdSRuslan ErmilovIt can be turned on or off 26854e347fbSGordon Tetlowby the 26954e347fbSGordon Tetlow.Xr rc.conf 5 27054e347fbSGordon Tetlowvariable 271eec3e03eSRuslan Ermilov.Va rc_debug . 272aa3b7a2fSSimon J. Gerraty.It Ic dot Ar file ... 273aa3b7a2fSSimon J. GerratyFor reading in unverified files. 274aa3b7a2fSSimon J. Gerraty.Pp 275aa3b7a2fSSimon J. GerratyEnsure shell 276aa3b7a2fSSimon J. Gerraty.Li verify 277aa3b7a2fSSimon J. Gerratyoption is off. 278aa3b7a2fSSimon J. GerratyThis option is only meaningful when 279aa3b7a2fSSimon J. Gerraty.Xr mac_veriexec 4 280aa3b7a2fSSimon J. Gerratyis active. 281aa3b7a2fSSimon J. Gerraty.Pp 282aa3b7a2fSSimon J. GerratyRead each 283aa3b7a2fSSimon J. Gerraty.Ar file 284aa3b7a2fSSimon J. Gerratyif it exists. 285aa3b7a2fSSimon J. Gerraty.Pp 286aa3b7a2fSSimon J. GerratyRestore previous state of the 287aa3b7a2fSSimon J. Gerraty.Li verify 288aa3b7a2fSSimon J. Gerratyoption. 289eec3e03eSRuslan Ermilov.It Ic err Ar exitval message 29054e347fbSGordon TetlowDisplay an error message to 291eec3e03eSRuslan Ermilov.Va stderr , 29254e347fbSGordon Tetlowlog it to the system log 29354e347fbSGordon Tetlowusing 29454e347fbSGordon Tetlow.Xr logger 1 , 29554e347fbSGordon Tetlowand 296eec3e03eSRuslan Ermilov.Ic exit 29754e347fbSGordon Tetlowwith an exit value of 29854e347fbSGordon Tetlow.Ar exitval . 29954e347fbSGordon TetlowThe error message consists of the script name 30054e347fbSGordon Tetlow(from 301eec3e03eSRuslan Ermilov.Va $0 ) , 30254e347fbSGordon Tetlowfollowed by 303eec3e03eSRuslan Ermilov.Dq Li ": ERROR: " , 30454e347fbSGordon Tetlowand then 30554e347fbSGordon Tetlow.Ar message . 306fdec4b41SLars Engels.It Ic force_depend Ar name 30754e347fbSGordon TetlowOutput an advisory message and force the 30854e347fbSGordon Tetlow.Ar name 3095203edcdSRuslan Ermilovservice to start. 3105203edcdSRuslan ErmilovThe 31154e347fbSGordon Tetlow.Ar name 31254e347fbSGordon Tetlowargument is the 313eec3e03eSRuslan Ermilov.Xr basename 1 3145ccb7079SMateusz Piotrowskicomponent of the path to the script located at 3155ccb7079SMateusz Piotrowski.Pa /etc/rc.d 316d6dade00SMateusz Piotrowski(scripts stored in other locations such as 3175ccb7079SMateusz Piotrowski.Pa /usr/local/etc/rc.d 318d6dade00SMateusz Piotrowskicannot be controlled with 3195ccb7079SMateusz Piotrowski.Ic force_depend 3205ccb7079SMateusz Piotrowskicurrently). 32154e347fbSGordon TetlowIf the script fails for any reason it will output a warning 3225203edcdSRuslan Ermilovand return with a return value of 1. 3235203edcdSRuslan ErmilovIf it was successful 32454e347fbSGordon Tetlowit will return 0. 325aa3b7a2fSSimon J. Gerraty.It Ic is_verified Ar file 326aa3b7a2fSSimon J. GerratyIf 327aa3b7a2fSSimon J. Gerraty.Xr veriexec 8 328aa3b7a2fSSimon J. Gerratydoes not exist, or 329aa3b7a2fSSimon J. Gerraty.Xr mac_veriexec 4 330aa3b7a2fSSimon J. Gerratyis not active, just return success. 331aa3b7a2fSSimon J. GerratyOtherwise use 332aa3b7a2fSSimon J. Gerraty.Xr veriexec 8 333aa3b7a2fSSimon J. Gerratyto check if 334aa3b7a2fSSimon J. Gerraty.Ar file 335aa3b7a2fSSimon J. Gerratyis verified. 336aa3b7a2fSSimon J. GerratyIf not verified the return code will be 80 (EAUTH). 33754e347fbSGordon Tetlow.It Ic info Ar message 33854e347fbSGordon TetlowDisplay an informational message to 339eec3e03eSRuslan Ermilov.Va stdout , 34054e347fbSGordon Tetlowand log it to the system log using 34154e347fbSGordon Tetlow.Xr logger 1 . 34254e347fbSGordon TetlowThe message consists of the script name 34354e347fbSGordon Tetlow(from 344eec3e03eSRuslan Ermilov.Va $0 ) , 34554e347fbSGordon Tetlowfollowed by 346eec3e03eSRuslan Ermilov.Dq Li ": INFO: " , 34754e347fbSGordon Tetlowand then 34857bd0fc6SJens Schweikhardt.Ar message . 34954e347fbSGordon TetlowThe display of this informational output can be 35054e347fbSGordon Tetlowturned on or off by the 35154e347fbSGordon Tetlow.Xr rc.conf 5 35254e347fbSGordon Tetlowvariable 353eec3e03eSRuslan Ermilov.Va rc_info . 3541679c7f4SYaroslav Tykhiy.It Ic load_kld Oo Fl e Ar regex Oc Oo Fl m Ar module Oc Ar file 3551679c7f4SYaroslav TykhiyLoad 3561679c7f4SYaroslav Tykhiy.Ar file 3571679c7f4SYaroslav Tykhiyas a kernel module unless it is already loaded. 3581679c7f4SYaroslav TykhiyFor the purpose of checking the module status, 3591679c7f4SYaroslav Tykhiyeither the exact module name can be specified using 3601679c7f4SYaroslav Tykhiy.Fl m , 3611679c7f4SYaroslav Tykhiyor an 3621679c7f4SYaroslav Tykhiy.Xr egrep 1 3631679c7f4SYaroslav Tykhiyregular expression matching the module name can be supplied via 3641679c7f4SYaroslav Tykhiy.Fl e . 3651679c7f4SYaroslav TykhiyBy default, the module is assumed to have the same name as 3661679c7f4SYaroslav Tykhiy.Ar file , 3671679c7f4SYaroslav Tykhiywhich is not always the case. 368aa3b7a2fSSimon J. Gerraty.It Ic load_rc_config Oo Ar flag Oc Op Ar service 3695d21348dSMateusz PiotrowskiSource in the configuration file(s) for 3705d21348dSMateusz Piotrowski.Ar service . 3715d21348dSMateusz PiotrowskiIf no 3725d21348dSMateusz Piotrowski.Ar service 3735d21348dSMateusz Piotrowskiis specified, 3745d21348dSMateusz Piotrowskionly the global configuration file(s) will be loaded. 37554e347fbSGordon TetlowFirst, 37654e347fbSGordon Tetlow.Pa /etc/rc.conf 3773081bf98SFlorent Thoumieis sourced if it has not yet been read in. 37854e347fbSGordon TetlowThen, 3795d21348dSMateusz Piotrowski.Pa /etc/rc.conf.d/ Ns Ar service 3803081bf98SFlorent Thoumieis sourced if it is an existing file. 3813081bf98SFlorent ThoumieThe latter may also contain other variable assignments to override 38254e347fbSGordon Tetlow.Ic run_rc_command 38354e347fbSGordon Tetlowarguments defined by the calling script, to provide an easy 38454e347fbSGordon Tetlowmechanism for an administrator to override the behaviour of a given 38554e347fbSGordon Tetlow.Xr rc.d 8 38654e347fbSGordon Tetlowscript without requiring the editing of that script. 387aa3b7a2fSSimon J. Gerraty.Pp 38841f9823eSSimon J. GerratyThe function named by 38941f9823eSSimon J. Gerraty.Va load_rc_config_reader 39041f9823eSSimon J. Gerraty(default is 39141f9823eSSimon J. Gerraty.Ic dot ) 392aa3b7a2fSSimon J. Gerratyis used to read configuration unless 393aa3b7a2fSSimon J. Gerraty.Ar flag 394aa3b7a2fSSimon J. Gerratyis: 395aa3b7a2fSSimon J. Gerraty.Bl -tag -width Ds 396aa3b7a2fSSimon J. Gerraty.It Fl s 397aa3b7a2fSSimon J. Gerratyuse 398aa3b7a2fSSimon J. Gerraty.Ic sdot 399aa3b7a2fSSimon J. Gerratyto read configuration, 400aa3b7a2fSSimon J. Gerratybecause we want verified configuration or 401aa3b7a2fSSimon J. Gerratyto use 402aa3b7a2fSSimon J. Gerraty.Ic safe_dot 403aa3b7a2fSSimon J. Gerratyto read an unverified configuration. 404aa3b7a2fSSimon J. Gerraty.It Fl v 405aa3b7a2fSSimon J. Gerratyuse 406aa3b7a2fSSimon J. Gerraty.Ic vdot 407aa3b7a2fSSimon J. Gerratyto read in configuration only if it is verified. 408aa3b7a2fSSimon J. Gerraty.El 40941f9823eSSimon J. Gerraty.Pp 41041f9823eSSimon J. Gerraty.Ic DebugOn 41141f9823eSSimon J. Gerratywill be called with tags derived from 41241f9823eSSimon J. Gerraty.Ar name 41341f9823eSSimon J. Gerratyto enable tracing if any appear in 41441f9823eSSimon J. Gerraty.Va DEBUG_SH . 4158d2e10d0SFlorent Thoumie.It Ic load_rc_config_var Ar name Ar var 41646587ab8SFlorent ThoumieRead the 41746587ab8SFlorent Thoumie.Xr rc.conf 5 41846587ab8SFlorent Thoumievariable 41946587ab8SFlorent Thoumie.Ar var 42046587ab8SFlorent Thoumiefor 4218d2e10d0SFlorent Thoumie.Ar name 42246587ab8SFlorent Thoumieand set in the current shell, using 42346587ab8SFlorent Thoumie.Ic load_rc_config 42446587ab8SFlorent Thoumiein a sub-shell to prevent unwanted side effects from other variable 42546587ab8SFlorent Thoumieassignments. 42654e347fbSGordon Tetlow.It Ic mount_critical_filesystems Ar type 42754e347fbSGordon TetlowGo through a list of critical file systems, 42854e347fbSGordon Tetlowas found in the 42954e347fbSGordon Tetlow.Xr rc.conf 5 43054e347fbSGordon Tetlowvariable 431eec3e03eSRuslan Ermilov.Va critical_filesystems_ Ns Ar type , 43254e347fbSGordon Tetlowmounting each one that 43354e347fbSGordon Tetlowis not currently mounted. 434aa3b7a2fSSimon J. Gerraty.It Ic rc_log Ar message 435aa3b7a2fSSimon J. GerratyOutput 436aa3b7a2fSSimon J. Gerraty.Ar message 437aa3b7a2fSSimon J. Gerratywith a timestamp, which is both human readable and 438aa3b7a2fSSimon J. Gerratyeasily parsed for post processing, using: 439aa3b7a2fSSimon J. Gerraty.Bd -literal -offset indent 440aa3b7a2fSSimon J. Gerratydate "+@ %s [%Y-%m-%d %H:%M:%S %Z] $*" 441aa3b7a2fSSimon J. Gerraty.Ed 442aa3b7a2fSSimon J. Gerraty.It Ic rc_trace Ar level Ar message 443aa3b7a2fSSimon J. GerratyIf the file 444aa3b7a2fSSimon J. Gerraty.Pa /etc/rc.conf.d/rc_trace 445aa3b7a2fSSimon J. Gerratyexists and is not empty attempt to set 446aa3b7a2fSSimon J. Gerraty.Va RC_LEVEL 447aa3b7a2fSSimon J. Gerratybased on its content. 448aa3b7a2fSSimon J. GerratyIf the file is empty or does not contain 449aa3b7a2fSSimon J. Gerratya value for 450aa3b7a2fSSimon J. Gerraty.Va RC_LEVEL , 451aa3b7a2fSSimon J. Gerratyset it to 45241f9823eSSimon J. Gerraty.Li 0 . 453aa3b7a2fSSimon J. Gerraty.Pp 454aa3b7a2fSSimon J. GerratyIf 455aa3b7a2fSSimon J. Gerraty.Ar level 456aa3b7a2fSSimon J. Gerratyis greater than or equal to 457aa3b7a2fSSimon J. Gerraty.Va RC_LEVEL 458aa3b7a2fSSimon J. Gerratypass 459aa3b7a2fSSimon J. Gerraty.Ar message 460aa3b7a2fSSimon J. Gerratyto 461aa3b7a2fSSimon J. Gerraty.Ic rc_log . 462eec3e03eSRuslan Ermilov.It Ic rc_usage Ar command ... 46354e347fbSGordon TetlowPrint a usage message for 464eec3e03eSRuslan Ermilov.Va $0 , 46554e347fbSGordon Tetlowwith 46654e347fbSGordon Tetlow.Ar commands 46754e347fbSGordon Tetlowbeing the list of valid arguments 46854e347fbSGordon Tetlowprefixed by 469eec3e03eSRuslan Ermilov.Sm off 4700113cca4SEygene Ryabinkin.Dq Bq Li fast | force | one | quiet . 471eec3e03eSRuslan Ermilov.Sm on 472eec3e03eSRuslan Ermilov.It Ic reverse_list Ar item ... 47354e347fbSGordon TetlowPrint the list of 47454e347fbSGordon Tetlow.Ar items 47554e347fbSGordon Tetlowin reverse order. 47654e347fbSGordon Tetlow.It Ic run_rc_command Ar argument 47754e347fbSGordon TetlowRun the 47854e347fbSGordon Tetlow.Ar argument 47954e347fbSGordon Tetlowmethod for the current 48054e347fbSGordon Tetlow.Xr rc.d 8 48154e347fbSGordon Tetlowscript, based on the settings of various shell variables. 48254e347fbSGordon Tetlow.Ic run_rc_command 48354e347fbSGordon Tetlowis extremely flexible, and allows fully functional 48454e347fbSGordon Tetlow.Xr rc.d 8 48554e347fbSGordon Tetlowscripts to be implemented in a small amount of shell code. 48654e347fbSGordon Tetlow.Pp 48754e347fbSGordon Tetlow.Ar argument 48854e347fbSGordon Tetlowis searched for in the list of supported commands, which may be one 48954e347fbSGordon Tetlowof: 49085986815SMateusz Piotrowski.Bl -tag -width "restart" -offset indent 491eec3e03eSRuslan Ermilov.It Cm start 4924f779fd6SMike MakonnenStart the service. 4934f779fd6SMike MakonnenThis should check that the service is to be started as specified by 4944f779fd6SMike Makonnen.Xr rc.conf 5 . 4954f779fd6SMike MakonnenAlso checks if the service is already running and refuses to start if 4964f779fd6SMike Makonnenit is. 4974f779fd6SMike MakonnenThis latter check is not performed by standard 4984f779fd6SMike Makonnen.Fx 4994f779fd6SMike Makonnenscripts if the system is starting directly to multi-user mode, to 5004f779fd6SMike Makonnenspeed up the boot process. 501eec3e03eSRuslan Ermilov.It Cm stop 5024f779fd6SMike MakonnenIf the service is to be started as specified by 5034f779fd6SMike Makonnen.Xr rc.conf 5 , 5044f779fd6SMike Makonnenstop the service. 505eec3e03eSRuslan ErmilovThis should check that the service is running and complain if it is not. 506eec3e03eSRuslan Ermilov.It Cm restart 5074f779fd6SMike MakonnenPerform a 508eec3e03eSRuslan Ermilov.Cm stop 5094f779fd6SMike Makonnenthen a 510eec3e03eSRuslan Ermilov.Cm start . 5114f779fd6SMike MakonnenDefaults to displaying the process ID of the program (if running). 51249cede74SDag-Erling Smørgrav.It Cm enabled 51349cede74SDag-Erling SmørgravReturn 0 if the service is enabled and 1 if it is not. 51449cede74SDag-Erling SmørgravThis command does not print anything. 515eec3e03eSRuslan Ermilov.It Cm rcvar 5164f779fd6SMike MakonnenDisplay which 5174f779fd6SMike Makonnen.Xr rc.conf 5 5184f779fd6SMike Makonnenvariables are used to control the startup of the service (if any). 5194f779fd6SMike Makonnen.El 5204f779fd6SMike Makonnen.Pp 52154e347fbSGordon TetlowIf 522eec3e03eSRuslan Ermilov.Va pidfile 52354e347fbSGordon Tetlowor 524eec3e03eSRuslan Ermilov.Va procname 5254f779fd6SMike Makonnenis set, also support: 52685986815SMateusz Piotrowski.Bl -tag -width "status" -offset indent 527eec3e03eSRuslan Ermilov.It Cm poll 5284f779fd6SMike MakonnenWait for the command to exit. 529eec3e03eSRuslan Ermilov.It Cm status 5304f779fd6SMike MakonnenShow the status of the process. 5314f779fd6SMike Makonnen.El 5324f779fd6SMike Makonnen.Pp 5334f779fd6SMike MakonnenOther supported commands are listed in the optional variable 534eec3e03eSRuslan Ermilov.Va extra_commands . 53554e347fbSGordon Tetlow.Pp 53654e347fbSGordon Tetlow.Ar argument 53754e347fbSGordon Tetlowmay have one of the following prefixes which alters its operation: 53885986815SMateusz Piotrowski.Bl -tag -width "force" -offset indent 539eec3e03eSRuslan Ermilov.It Li fast 54054e347fbSGordon TetlowSkip the check for an existing running process, 54154e347fbSGordon Tetlowand sets 542eec3e03eSRuslan Ermilov.Va rc_fast Ns = Ns Li YES . 543eec3e03eSRuslan Ermilov.It Li force 54454e347fbSGordon TetlowSkip the checks for 545eec3e03eSRuslan Ermilov.Va rcvar 546eec3e03eSRuslan Ermilovbeing set to 547eec3e03eSRuslan Ermilov.Dq Li YES , 54854e347fbSGordon Tetlowand sets 549eec3e03eSRuslan Ermilov.Va rc_force Ns = Ns Li YES . 55054e347fbSGordon TetlowThis ignores 551eec3e03eSRuslan Ermilov.Ar argument Ns Va _precmd 55254e347fbSGordon Tetlowreturning non-zero, and ignores any of the 553eec3e03eSRuslan Ermilov.Va required_* 5544f779fd6SMike Makonnentests failing, and always returns a zero exit status. 555eec3e03eSRuslan Ermilov.It Li one 5564f779fd6SMike MakonnenSkip the checks for 557eec3e03eSRuslan Ermilov.Va rcvar 558eec3e03eSRuslan Ermilovbeing set to 559eec3e03eSRuslan Ermilov.Dq Li YES , 560eec3e03eSRuslan Ermilovbut performs all the other prerequisite tests. 5610113cca4SEygene Ryabinkin.It Li quiet 5620113cca4SEygene RyabinkinInhibits some verbose diagnostics. 5630113cca4SEygene RyabinkinCurrently, this includes messages 5640113cca4SEygene Ryabinkin.Qq Starting ${name} 5650113cca4SEygene Ryabinkin(as checked by 5660113cca4SEygene Ryabinkin.Ic check_startmsgs 5670113cca4SEygene Ryabinkininside 5680113cca4SEygene Ryabinkin.Nm ) 5690113cca4SEygene Ryabinkinand errors about usage of services that are not enabled in 5700113cca4SEygene Ryabinkin.Xr rc.conf 5 . 5710113cca4SEygene RyabinkinThis prefix also sets 5720113cca4SEygene Ryabinkin.Va rc_quiet Ns = Ns Li YES . 573fa1dab78SMateusz Piotrowski.Em Note : 5740113cca4SEygene Ryabinkin.Va rc_quiet 5750113cca4SEygene Ryabinkinis not intended to completely mask all debug and warning messages, 5760113cca4SEygene Ryabinkinbut only certain small classes of them. 57754e347fbSGordon Tetlow.El 57854e347fbSGordon Tetlow.Pp 57954e347fbSGordon Tetlow.Ic run_rc_command 58054e347fbSGordon Tetlowuses the following shell variables to control its behaviour. 58154e347fbSGordon TetlowUnless otherwise stated, these are optional. 58285986815SMateusz Piotrowski.Bl -tag -width "procname" -offset indent 583eec3e03eSRuslan Ermilov.It Va name 58454e347fbSGordon TetlowThe name of this script. 58554e347fbSGordon TetlowThis is not optional. 586eec3e03eSRuslan Ermilov.It Va rcvar 58754e347fbSGordon TetlowThe value of 588eec3e03eSRuslan Ermilov.Va rcvar 58954e347fbSGordon Tetlowis checked with 59054e347fbSGordon Tetlow.Ic checkyesno 59154e347fbSGordon Tetlowto determine if this method should be run. 592eec3e03eSRuslan Ermilov.It Va command 59354e347fbSGordon TetlowFull path to the command. 59454e347fbSGordon TetlowNot required if 595eec3e03eSRuslan Ermilov.Ar argument Ns Va _cmd 59654e347fbSGordon Tetlowis defined for each supported keyword. 59791387563SYaroslav TykhiyCan be overridden by 59891387563SYaroslav Tykhiy.Va ${name}_program . 599eec3e03eSRuslan Ermilov.It Va command_args 60054e347fbSGordon TetlowOptional arguments and/or shell directives for 601eec3e03eSRuslan Ermilov.Va command . 602eec3e03eSRuslan Ermilov.It Va command_interpreter 603eec3e03eSRuslan Ermilov.Va command 6048d52cc90SYaroslav Tykhiyis started with: 605eec3e03eSRuslan Ermilov.Pp 606eec3e03eSRuslan Ermilov.Dl "#! command_interpreter [...]" 6078d52cc90SYaroslav Tykhiy.Pp 60854e347fbSGordon Tetlowwhich results in its 60954e347fbSGordon Tetlow.Xr ps 1 6108d52cc90SYaroslav Tykhiycommand being: 611eec3e03eSRuslan Ermilov.Pp 612eec3e03eSRuslan Ermilov.Dl "command_interpreter [...] command" 613eec3e03eSRuslan Ermilov.Pp 61454e347fbSGordon Tetlowso use that string to find the PID(s) of the running command 61554e347fbSGordon Tetlowrather than 616eec3e03eSRuslan Ermilov.Va command . 617eec3e03eSRuslan Ermilov.It Va extra_commands 61854e347fbSGordon TetlowExtra commands/keywords/arguments supported. 619eec3e03eSRuslan Ermilov.It Va pidfile 620eec3e03eSRuslan ErmilovPath to PID file. 62154e347fbSGordon TetlowUsed to determine the PID(s) of the running command. 62254e347fbSGordon TetlowIf 623eec3e03eSRuslan Ermilov.Va pidfile 6248d52cc90SYaroslav Tykhiyis set, use: 625eec3e03eSRuslan Ermilov.Pp 626eec3e03eSRuslan Ermilov.Dl "check_pidfile $pidfile $procname" 627eec3e03eSRuslan Ermilov.Pp 62854e347fbSGordon Tetlowto find the PID. 62954e347fbSGordon TetlowOtherwise, if 630eec3e03eSRuslan Ermilov.Va command 6318d52cc90SYaroslav Tykhiyis set, use: 632eec3e03eSRuslan Ermilov.Pp 633eec3e03eSRuslan Ermilov.Dl "check_process $procname" 634eec3e03eSRuslan Ermilov.Pp 63554e347fbSGordon Tetlowto find the PID. 636eec3e03eSRuslan Ermilov.It Va procname 63754e347fbSGordon TetlowProcess name to check for. 63854e347fbSGordon TetlowDefaults to the value of 639eec3e03eSRuslan Ermilov.Va command . 640eec3e03eSRuslan Ermilov.It Va required_dirs 64154e347fbSGordon TetlowCheck for the existence of the listed directories 6426a8cdb5aSYaroslav Tykhiybefore running the 643016c675dSYaroslav Tykhiy.Cm start 644016c675dSYaroslav Tykhiymethod. 645fda4dad5SMateusz PiotrowskiThe list is checked before running 646fda4dad5SMateusz Piotrowski.Va start_precmd . 647eec3e03eSRuslan Ermilov.It Va required_files 64854e347fbSGordon TetlowCheck for the readability of the listed files 6496a8cdb5aSYaroslav Tykhiybefore running the 650016c675dSYaroslav Tykhiy.Cm start 651016c675dSYaroslav Tykhiymethod. 652fda4dad5SMateusz PiotrowskiThe list is checked before running 653fda4dad5SMateusz Piotrowski.Va start_precmd . 6546a8cdb5aSYaroslav Tykhiy.It Va required_modules 6556a8cdb5aSYaroslav TykhiyEnsure that the listed kernel modules are loaded 6566a8cdb5aSYaroslav Tykhiybefore running the 6576a8cdb5aSYaroslav Tykhiy.Cm start 6586a8cdb5aSYaroslav Tykhiymethod. 659fda4dad5SMateusz PiotrowskiThe list is checked after running 660fda4dad5SMateusz Piotrowski.Va start_precmd . 6616a8cdb5aSYaroslav TykhiyThis is done after invoking the commands from 6626a8cdb5aSYaroslav Tykhiy.Va start_precmd 6636a8cdb5aSYaroslav Tykhiyso that the missing modules are not loaded in vain 6646a8cdb5aSYaroslav Tykhiyif the preliminary commands indicate a error condition. 6656a8cdb5aSYaroslav TykhiyA word in the list can have an optional 666293f5f02SMateusz Piotrowski.Dq Li \&: Ns Ar modname 6676a8cdb5aSYaroslav Tykhiyor 6686a8cdb5aSYaroslav Tykhiy.Dq Li ~ Ns Ar pattern 6696a8cdb5aSYaroslav Tykhiysuffix. 6706a8cdb5aSYaroslav TykhiyThe 6716a8cdb5aSYaroslav Tykhiy.Ar modname 6726a8cdb5aSYaroslav Tykhiyor 6736a8cdb5aSYaroslav Tykhiy.Ar pattern 6746a8cdb5aSYaroslav Tykhiyparameter is passed to 6756a8cdb5aSYaroslav Tykhiy.Ic load_kld 6766a8cdb5aSYaroslav Tykhiythrough a 6776a8cdb5aSYaroslav Tykhiy.Fl m 6786a8cdb5aSYaroslav Tykhiyor 6796a8cdb5aSYaroslav Tykhiy.Fl e 6806a8cdb5aSYaroslav Tykhiyoption, respectively. 6816a8cdb5aSYaroslav TykhiySee the description of 6826a8cdb5aSYaroslav Tykhiy.Ic load_kld 6836a8cdb5aSYaroslav Tykhiyin this document for details. 684eec3e03eSRuslan Ermilov.It Va required_vars 68554e347fbSGordon TetlowPerform 68654e347fbSGordon Tetlow.Ic checkyesno 68754e347fbSGordon Tetlowon each of the list variables 6886a8cdb5aSYaroslav Tykhiybefore running the 689016c675dSYaroslav Tykhiy.Cm start 690016c675dSYaroslav Tykhiymethod. 691fda4dad5SMateusz PiotrowskiThe list is checked after running 692fda4dad5SMateusz Piotrowski.Va start_precmd . 693eec3e03eSRuslan Ermilov.It Va ${name}_chdir 69454e347fbSGordon TetlowDirectory to 69554e347fbSGordon Tetlow.Ic cd 69654e347fbSGordon Tetlowto before running 697eec3e03eSRuslan Ermilov.Va command , 69854e347fbSGordon Tetlowif 699eec3e03eSRuslan Ermilov.Va ${name}_chroot 70054e347fbSGordon Tetlowis not provided. 701eec3e03eSRuslan Ermilov.It Va ${name}_chroot 70254e347fbSGordon TetlowDirectory to 70354e347fbSGordon Tetlow.Xr chroot 8 70454e347fbSGordon Tetlowto before running 705eec3e03eSRuslan Ermilov.Va command . 70654e347fbSGordon TetlowOnly supported after 70754e347fbSGordon Tetlow.Pa /usr 70854e347fbSGordon Tetlowis mounted. 70961a8e849SHiroki Sato.It Va ${name}_env 71061a8e849SHiroki SatoA list of environment variables to run 71161a8e849SHiroki Sato.Va command 71261a8e849SHiroki Satowith. 713d15e810dSMateusz PiotrowskiThose variables will be passed as arguments to the 71461a8e849SHiroki Sato.Xr env 1 715d15e810dSMateusz Piotrowskiutility unless 716d15e810dSMateusz Piotrowski.Ar argument Ns Va _cmd 717d15e810dSMateusz Piotrowskiis defined. 718d15e810dSMateusz PiotrowskiIn that case the contents of 719d15e810dSMateusz Piotrowski.Va ${name}_env 720d15e810dSMateusz Piotrowskiwill be exported via the 721d15e810dSMateusz Piotrowski.Xr export 1 722d15e810dSMateusz Piotrowskibuiltin of 723d15e810dSMateusz Piotrowski.Xr sh 1 , 724d15e810dSMateusz Piotrowskiwhich puts some limitations on the names of variables 725d15e810dSMateusz Piotrowski(e.g., a variable name may not start with a digit). 7266b82569fSMark Felder.It Va ${name}_env_file 7276b82569fSMark FelderA file to source for environmental variables to run 7286b82569fSMark Felder.Va command 7296b82569fSMark Felderwith. 730fa1dab78SMateusz Piotrowski.Em Note : 731fa1dab78SMateusz Piotrowskiall the variables which are being assigned in this file are going 7326b82569fSMark Felderto be exported into the environment of 7336b82569fSMark Felder.Va command . 73461a8e849SHiroki Sato.It Va ${name}_fib 73561a8e849SHiroki SatoFIB 73661a8e849SHiroki Sato.Pa Routing Table 73761a8e849SHiroki Satonumber to run 73861a8e849SHiroki Sato.Va command 73961a8e849SHiroki Satowith. 74061a8e849SHiroki SatoSee 74161a8e849SHiroki Sato.Xr setfib 1 74261a8e849SHiroki Satofor more details. 743eec3e03eSRuslan Ermilov.It Va ${name}_flags 74454e347fbSGordon TetlowArguments to call 745eec3e03eSRuslan Ermilov.Va command 74654e347fbSGordon Tetlowwith. 74754e347fbSGordon TetlowThis is usually set in 74854e347fbSGordon Tetlow.Xr rc.conf 5 , 74954e347fbSGordon Tetlowand not in the 75054e347fbSGordon Tetlow.Xr rc.d 8 75154e347fbSGordon Tetlowscript. 75254e347fbSGordon TetlowThe environment variable 75354e347fbSGordon Tetlow.Sq Ev flags 75454e347fbSGordon Tetlowcan be used to override this. 755eec3e03eSRuslan Ermilov.It Va ${name}_nice 75654e347fbSGordon Tetlow.Xr nice 1 75754e347fbSGordon Tetlowlevel to run 758eec3e03eSRuslan Ermilov.Va command 75954e347fbSGordon Tetlowas. 76054e347fbSGordon TetlowOnly supported after 76154e347fbSGordon Tetlow.Pa /usr 76254e347fbSGordon Tetlowis mounted. 76352d7a78fSDmitry Marakasov.It Va ${name}_limits 7643c3b8a0eSJilles TjoelkerResource limits to apply to 76552d7a78fSDmitry Marakasov.Va command . 76652d7a78fSDmitry MarakasovThis will be passed as arguments to the 76752d7a78fSDmitry Marakasov.Xr limits 1 76852d7a78fSDmitry Marakasovutility. 7693c3b8a0eSJilles TjoelkerBy default, the resource limits are based on the login class defined in 7703c3b8a0eSJilles Tjoelker.Va ${name}_login_class . 7713c3b8a0eSJilles Tjoelker.It Va ${name}_login_class 7723c3b8a0eSJilles TjoelkerLogin class to use with 7733c3b8a0eSJilles Tjoelker.Va ${name}_limits . 7743c3b8a0eSJilles TjoelkerDefaults to 7753c3b8a0eSJilles Tjoelker.Dq Li daemon . 77632a579e4SEugene Grosbein.It Va ${name}_offcmd 777af1b0aa5SEugene GrosbeinShell commands to run during start if a service is not enabled. 7783bead71eSMarcelo Araujo.It Va ${name}_oomprotect 7793bead71eSMarcelo Araujo.Xr protect 1 7803bead71eSMarcelo Araujo.Va command 7813bead71eSMarcelo Araujofrom being killed when swap space is exhausted. 7823bead71eSMarcelo AraujoIf 7833c3b8a0eSJilles Tjoelker.Dq Li YES 7843bead71eSMarcelo Araujois used, no child processes are protected. 7853bead71eSMarcelo AraujoIf 7863c3b8a0eSJilles Tjoelker.Dq Li ALL , 7873bead71eSMarcelo Araujoprotect all child processes. 78891387563SYaroslav Tykhiy.It Va ${name}_program 78991387563SYaroslav TykhiyFull path to the command. 79091387563SYaroslav TykhiyOverrides 79191387563SYaroslav Tykhiy.Va command 79291387563SYaroslav Tykhiyif both are set, but has no effect if 79391387563SYaroslav Tykhiy.Va command 79491387563SYaroslav Tykhiyis unset. 79591387563SYaroslav TykhiyAs a rule, 79691387563SYaroslav Tykhiy.Va command 79791387563SYaroslav Tykhiyshould be set in the script while 79891387563SYaroslav Tykhiy.Va ${name}_program 79991387563SYaroslav Tykhiyshould be set in 80091387563SYaroslav Tykhiy.Xr rc.conf 5 . 801eec3e03eSRuslan Ermilov.It Va ${name}_user 80254e347fbSGordon TetlowUser to run 803eec3e03eSRuslan Ermilov.Va command 80454e347fbSGordon Tetlowas, using 805836d250dSSergey Skvortsov.Xr chroot 8 80654e347fbSGordon Tetlowif 807eec3e03eSRuslan Ermilov.Va ${name}_chroot 80854e347fbSGordon Tetlowis set, otherwise 80954e347fbSGordon Tetlowuses 81054e347fbSGordon Tetlow.Xr su 1 . 81154e347fbSGordon TetlowOnly supported after 81254e347fbSGordon Tetlow.Pa /usr 81354e347fbSGordon Tetlowis mounted. 814eec3e03eSRuslan Ermilov.It Va ${name}_group 81554e347fbSGordon TetlowGroup to run the chrooted 816eec3e03eSRuslan Ermilov.Va command 81754e347fbSGordon Tetlowas. 818eec3e03eSRuslan Ermilov.It Va ${name}_groups 81954e347fbSGordon TetlowComma separated list of supplementary groups to run the chrooted 820eec3e03eSRuslan Ermilov.Va command 82154e347fbSGordon Tetlowwith. 82261a8e849SHiroki Sato.It Va ${name}_prepend 82361a8e849SHiroki SatoCommands to be prepended to 82461a8e849SHiroki Sato.Va command . 82561a8e849SHiroki SatoThis is a generic version of 82661a8e849SHiroki Sato.Va ${name}_env , 82761a8e849SHiroki Sato.Va ${name}_fib , 82861a8e849SHiroki Satoor 82961a8e849SHiroki Sato.Va ${name}_nice . 830b05e7e70SFranco Fichtner.It Va ${name}_setup 83111333dd5SFranco FichtnerOptional command to be run during 83211333dd5SFranco Fichtner.Cm start , 83311333dd5SFranco Fichtner.Cm restart , 83411333dd5SFranco Fichtnerand 83511333dd5SFranco Fichtner.Cm reload 83611333dd5SFranco Fichtnerprior to the respective 83711333dd5SFranco Fichtner.Ar argument Ns Va _precmd . 83811333dd5SFranco FichtnerIf the command fails for any reason it will output a warning, 83911333dd5SFranco Fichtnerbut execution will continue. 840eec3e03eSRuslan Ermilov.It Ar argument Ns Va _cmd 84154e347fbSGordon TetlowShell commands which override the default method for 84254e347fbSGordon Tetlow.Ar argument . 843eec3e03eSRuslan Ermilov.It Ar argument Ns Va _precmd 84454e347fbSGordon TetlowShell commands to run just before running 845eec3e03eSRuslan Ermilov.Ar argument Ns Va _cmd 84654e347fbSGordon Tetlowor the default method for 84754e347fbSGordon Tetlow.Ar argument . 84854e347fbSGordon TetlowIf this returns a non-zero exit code, the main method is not performed. 84954e347fbSGordon TetlowIf the default method is being executed, this check is performed after 85054e347fbSGordon Tetlowthe 851eec3e03eSRuslan Ermilov.Va required_* 85254e347fbSGordon Tetlowchecks and process (non-)existence checks. 853eec3e03eSRuslan Ermilov.It Ar argument Ns Va _postcmd 85454e347fbSGordon TetlowShell commands to run if running 855eec3e03eSRuslan Ermilov.Ar argument Ns Va _cmd 85654e347fbSGordon Tetlowor the default method for 85754e347fbSGordon Tetlow.Ar argument 85854e347fbSGordon Tetlowreturned a zero exit code. 859eec3e03eSRuslan Ermilov.It Va sig_stop 86054e347fbSGordon TetlowSignal to send the processes to stop in the default 861eec3e03eSRuslan Ermilov.Cm stop 86254e347fbSGordon Tetlowmethod. 86354e347fbSGordon TetlowDefaults to 86454e347fbSGordon Tetlow.Dv SIGTERM . 865eec3e03eSRuslan Ermilov.It Va sig_reload 86654e347fbSGordon TetlowSignal to send the processes to reload in the default 867eec3e03eSRuslan Ermilov.Cm reload 86854e347fbSGordon Tetlowmethod. 86954e347fbSGordon TetlowDefaults to 87054e347fbSGordon Tetlow.Dv SIGHUP . 87154e347fbSGordon Tetlow.El 87254e347fbSGordon Tetlow.Pp 87354e347fbSGordon TetlowFor a given method 87454e347fbSGordon Tetlow.Ar argument , 87554e347fbSGordon Tetlowif 876eec3e03eSRuslan Ermilov.Ar argument Ns Va _cmd 87754e347fbSGordon Tetlowis not defined, then a default method is provided by 878eec3e03eSRuslan Ermilov.Ic run_rc_command : 8796e414739SMateusz Piotrowski.Bl -column "Argument" "Default Method" -offset indent 8806e414739SMateusz Piotrowski.It Sy Argument Ta Sy Default method 8816e414739SMateusz Piotrowski.It Cm start Ta 88254e347fbSGordon TetlowIf 883eec3e03eSRuslan Ermilov.Va command 88454e347fbSGordon Tetlowis not running and 885eec3e03eSRuslan Ermilov.Ic checkyesno Va rcvar 88654e347fbSGordon Tetlowsucceeds, start 887eec3e03eSRuslan Ermilov.Va command . 8886e414739SMateusz Piotrowski.It Cm stop Ta 88954e347fbSGordon TetlowDetermine the PIDs of 890eec3e03eSRuslan Ermilov.Va command 89154e347fbSGordon Tetlowwith 89254e347fbSGordon Tetlow.Ic check_pidfile 89354e347fbSGordon Tetlowor 89454e347fbSGordon Tetlow.Ic check_process 89554e347fbSGordon Tetlow(as appropriate), 896eec3e03eSRuslan Ermilov.Ic kill Va sig_stop 89754e347fbSGordon Tetlowthose PIDs, and run 89854e347fbSGordon Tetlow.Ic wait_for_pids 89954e347fbSGordon Tetlowon those PIDs. 9006e414739SMateusz Piotrowski.It Cm reload Ta 90154e347fbSGordon TetlowSimilar to 902eec3e03eSRuslan Ermilov.Cm stop , 90354e347fbSGordon Tetlowexcept that it uses 904eec3e03eSRuslan Ermilov.Va sig_reload 905eec3e03eSRuslan Ermilovinstead, and does not run 90654e347fbSGordon Tetlow.Ic wait_for_pids . 9075a3c72ceSYaroslav TykhiyAnother difference from 9085a3c72ceSYaroslav Tykhiy.Cm stop 9095a3c72ceSYaroslav Tykhiyis that 9105a3c72ceSYaroslav Tykhiy.Cm reload 9115a3c72ceSYaroslav Tykhiyis not provided by default. 9125a3c72ceSYaroslav TykhiyIt can be enabled via 9135a3c72ceSYaroslav Tykhiy.Va extra_commands 9145a3c72ceSYaroslav Tykhiyif appropriate: 9155a3c72ceSYaroslav Tykhiy.Pp 9165a3c72ceSYaroslav Tykhiy.Dl "extra_commands=reload" 9176e414739SMateusz Piotrowski.It Cm restart Ta 91854e347fbSGordon TetlowRuns the 919eec3e03eSRuslan Ermilov.Cm stop 92054e347fbSGordon Tetlowmethod, then the 921eec3e03eSRuslan Ermilov.Cm start 92254e347fbSGordon Tetlowmethod. 9236e414739SMateusz Piotrowski.It Cm status Ta 92454e347fbSGordon TetlowShow the PID of 925eec3e03eSRuslan Ermilov.Va command , 92654e347fbSGordon Tetlowor some other script specific status operation. 9276e414739SMateusz Piotrowski.It Cm poll Ta 92854e347fbSGordon TetlowWait for 929eec3e03eSRuslan Ermilov.Va command 93054e347fbSGordon Tetlowto exit. 9316e414739SMateusz Piotrowski.It Cm rcvar Ta 93254e347fbSGordon TetlowDisplay which 93354e347fbSGordon Tetlow.Xr rc.conf 5 93454e347fbSGordon Tetlowvariable is used (if any). 93554e347fbSGordon TetlowThis method always works, even if the appropriate 93654e347fbSGordon Tetlow.Xr rc.conf 5 93754e347fbSGordon Tetlowvariable is set to 938eec3e03eSRuslan Ermilov.Dq Li NO . 93954e347fbSGordon Tetlow.El 94054e347fbSGordon Tetlow.Pp 94154e347fbSGordon TetlowThe following variables are available to the methods 94254e347fbSGordon Tetlow(such as 943eec3e03eSRuslan Ermilov.Ar argument Ns Va _cmd ) 94454e347fbSGordon Tetlowas well as after 94554e347fbSGordon Tetlow.Ic run_rc_command 94654e347fbSGordon Tetlowhas completed: 94785986815SMateusz Piotrowski.Bl -tag -width "rc_service" -offset indent 948eec3e03eSRuslan Ermilov.It Va rc_arg 94954e347fbSGordon TetlowArgument provided to 950eec3e03eSRuslan Ermilov.Ic run_rc_command , 95154e347fbSGordon Tetlowafter fast and force processing has been performed. 952eec3e03eSRuslan Ermilov.It Va rc_flags 95357bd0fc6SJens SchweikhardtFlags to start the default command with. 95454e347fbSGordon TetlowDefaults to 955eec3e03eSRuslan Ermilov.Va ${name}_flags , 95654e347fbSGordon Tetlowunless overridden by the environment variable 95754e347fbSGordon Tetlow.Sq Ev flags . 95854e347fbSGordon TetlowThis variable may be changed by the 959eec3e03eSRuslan Ermilov.Ar argument Ns Va _precmd 96054e347fbSGordon Tetlowmethod. 961ac102a2aSKyle Evans.It Va rc_service 962ac102a2aSKyle EvansPath to the service script being executed, in case it needs to re-invoke itself. 963eec3e03eSRuslan Ermilov.It Va rc_pid 96454e347fbSGordon TetlowPID of 965eec3e03eSRuslan Ermilov.Va command 96654e347fbSGordon Tetlow(if appropriate). 967eec3e03eSRuslan Ermilov.It Va rc_fast 96854e347fbSGordon TetlowNot empty if 969eec3e03eSRuslan Ermilov.Dq Li fast 97054e347fbSGordon Tetlowprefix was used. 971eec3e03eSRuslan Ermilov.It Va rc_force 97254e347fbSGordon TetlowNot empty if 973eec3e03eSRuslan Ermilov.Dq Li force 97454e347fbSGordon Tetlowprefix was used. 97554e347fbSGordon Tetlow.El 976eec3e03eSRuslan Ermilov.It Ic run_rc_script Ar file argument 97754e347fbSGordon TetlowStart the script 97854e347fbSGordon Tetlow.Ar file 97954e347fbSGordon Tetlowwith an argument of 98054e347fbSGordon Tetlow.Ar argument , 98154e347fbSGordon Tetlowand handle the return value from the script. 98254e347fbSGordon Tetlow.Pp 98354e347fbSGordon TetlowVarious shell variables are unset before 98454e347fbSGordon Tetlow.Ar file 98554e347fbSGordon Tetlowis started: 98654e347fbSGordon Tetlow.Bd -ragged -offset indent 987eec3e03eSRuslan Ermilov.Va name , 988eec3e03eSRuslan Ermilov.Va command , 989eec3e03eSRuslan Ermilov.Va command_args , 990eec3e03eSRuslan Ermilov.Va command_interpreter , 991eec3e03eSRuslan Ermilov.Va extra_commands , 992eec3e03eSRuslan Ermilov.Va pidfile , 993eec3e03eSRuslan Ermilov.Va rcvar , 994eec3e03eSRuslan Ermilov.Va required_dirs , 995eec3e03eSRuslan Ermilov.Va required_files , 996eec3e03eSRuslan Ermilov.Va required_vars , 997eec3e03eSRuslan Ermilov.Ar argument Ns Va _cmd , 998eec3e03eSRuslan Ermilov.Ar argument Ns Va _precmd . 999eec3e03eSRuslan Ermilov.Ar argument Ns Va _postcmd . 100054e347fbSGordon Tetlow.Ed 100154e347fbSGordon Tetlow.Pp 1002aa3b7a2fSSimon J. GerratyCall 1003aa3b7a2fSSimon J. Gerraty.Ic rc_trace 1004aa3b7a2fSSimon J. Gerratyto indicate that 1005aa3b7a2fSSimon J. Gerraty.Ar file 1006aa3b7a2fSSimon J. Gerratyis to be run. 1007aa3b7a2fSSimon J. Gerraty.Pp 1008aa3b7a2fSSimon J. GerratyHowever, if 1009aa3b7a2fSSimon J. Gerraty.Ic is_verified Ar file 1010aa3b7a2fSSimon J. Gerratyfails, just return. 1011aa3b7a2fSSimon J. Gerraty.Pp 101241f9823eSSimon J. Gerraty.Ic DebugOn 101341f9823eSSimon J. Gerratywill be called with tags derrived from 101441f9823eSSimon J. Gerraty.Va name 101541f9823eSSimon J. Gerratyand 101641f9823eSSimon J. Gerraty.Va rc_arg 101741f9823eSSimon J. Gerratyto enable tracing if any of those tags appear in 101841f9823eSSimon J. Gerraty.Va DEBUG_SH . 101941f9823eSSimon J. Gerraty.Pp 1020*a5ad360fSMateusz Piotrowski.Ic run_rc_script 1021*a5ad360fSMateusz Piotrowskiexecutes 102254e347fbSGordon Tetlow.Ar file 1023*a5ad360fSMateusz Piotrowskiunless: 102454e347fbSGordon Tetlow.Bl -enum 102554e347fbSGordon Tetlow.It 102654e347fbSGordon Tetlow.Ar file 102754e347fbSGordon Tetlowends in 1028*a5ad360fSMateusz Piotrowski.Pa .sh 1029*a5ad360fSMateusz Piotrowskiand lives in 1030*a5ad360fSMateusz Piotrowski.Pa /etc/rc.d . 103154e347fbSGordon Tetlow.It 103254e347fbSGordon Tetlow.Ar file 103354e347fbSGordon Tetlowappears to be a backup or scratch file 1034*a5ad360fSMateusz Piotrowski.Po e.g., with a suffix of 1035*a5ad360fSMateusz Piotrowski.Pa ~ , # , .OLD , ,v , 103654e347fbSGordon Tetlowor 1037*a5ad360fSMateusz Piotrowski.Pa .orig Pc . 103854e347fbSGordon Tetlow.It 103954e347fbSGordon Tetlow.Ar file 1040*a5ad360fSMateusz Piotrowskiis not executable. 104154e347fbSGordon Tetlow.El 1042aa3b7a2fSSimon J. Gerraty.It Ic run_rc_scripts Oo options Oc file ... 1043aa3b7a2fSSimon J. GerratyCall 1044aa3b7a2fSSimon J. Gerraty.Ic run_rc_script 1045aa3b7a2fSSimon J. Gerratyfor each 1046aa3b7a2fSSimon J. Gerraty.Ar file , 1047aa3b7a2fSSimon J. Gerratyunless it is already recorded as having been run. 1048aa3b7a2fSSimon J. Gerraty.Pp 1049aa3b7a2fSSimon J. GerratyThe 1050aa3b7a2fSSimon J. Gerraty.Ar options 1051aa3b7a2fSSimon J. Gerratyare: 1052aa3b7a2fSSimon J. Gerraty.Bl -tag -width "--break break" 1053aa3b7a2fSSimon J. Gerraty.It Ic --arg Ar arg 1054aa3b7a2fSSimon J. GerratyPass 1055aa3b7a2fSSimon J. Gerraty.Ar arg 1056aa3b7a2fSSimon J. Gerratyto 1057aa3b7a2fSSimon J. Gerraty.Ic run_rc_script , 1058aa3b7a2fSSimon J. Gerratydefault is 1059aa3b7a2fSSimon J. Gerraty.Ar _boot 1060aa3b7a2fSSimon J. Gerratyset by 1061aa3b7a2fSSimon J. Gerraty.Xr rc 8 . 1062aa3b7a2fSSimon J. Gerraty.It Ic --break Ar break 1063aa3b7a2fSSimon J. GerratyStop processing if any 1064aa3b7a2fSSimon J. Gerraty.Ar file 1065aa3b7a2fSSimon J. Gerratymatches any 1066aa3b7a2fSSimon J. Gerraty.Ar break 1067aa3b7a2fSSimon J. Gerraty.El 1068aa3b7a2fSSimon J. Gerraty.It Ic safe_dot Ar file ... 1069aa3b7a2fSSimon J. GerratyUsed by 1070aa3b7a2fSSimon J. Gerraty.Ic sdot 1071aa3b7a2fSSimon J. Gerratywhen 1072aa3b7a2fSSimon J. Gerraty.Xr mac_veriexec 4 1073aa3b7a2fSSimon J. Gerratyis active and 1074aa3b7a2fSSimon J. Gerraty.Ar file 1075aa3b7a2fSSimon J. Gerratyis not verified. 1076aa3b7a2fSSimon J. Gerraty.Pp 1077aa3b7a2fSSimon J. GerratyThis function limits the input from 1078aa3b7a2fSSimon J. Gerraty.Ar file 1079aa3b7a2fSSimon J. Gerratyto simple variable assignments with any 1080aa3b7a2fSSimon J. Gerratynon-alphanumeric characters replaced with 1081aa3b7a2fSSimon J. Gerraty.Ql _ . 1082aa3b7a2fSSimon J. Gerraty.It Ic sdot Ar file ... 1083aa3b7a2fSSimon J. GerratyFor reading in configuration files. 1084aa3b7a2fSSimon J. GerratySkip files that do not exist or are empty. 1085aa3b7a2fSSimon J. GerratyTry using 1086aa3b7a2fSSimon J. Gerraty.Ic vdot 1087aa3b7a2fSSimon J. Gerratyand if that fails (the file is unverified) 1088aa3b7a2fSSimon J. Gerratyfall back to using 1089aa3b7a2fSSimon J. Gerraty.Ic safe_dot . 1090325ebf37SJose Luis Duran.It Ic startmsg Oo Fl n Oc Ar message 1091325ebf37SJose Luis DuranDisplay a start message to 1092325ebf37SJose Luis Duran.Va stdout . 1093325ebf37SJose Luis DuranIt should be used instead of 1094325ebf37SJose Luis Duran.Xr echo 1 . 1095325ebf37SJose Luis DuranThe display of this output can be turned off if the 1096325ebf37SJose Luis Duran.Xr rc.conf 5 1097325ebf37SJose Luis Duranvariable 1098325ebf37SJose Luis Duran.Va rc_startmsgs 1099325ebf37SJose Luis Duranis set to 1100325ebf37SJose Luis Duran.Dq Li NO . 11013d03791bSMike Makonnen.It Ic stop_boot Op Ar always 11023d03791bSMike MakonnenPrevent booting to multiuser mode. 11033d03791bSMike MakonnenIf the 11048fe51638SYaroslav Tykhiy.Va autoboot 11058fe51638SYaroslav Tykhiyvariable is set to 11060b87619fSMateusz Piotrowski.Ql yes 11070b87619fSMateusz Piotrowski(see 11080b87619fSMateusz Piotrowski.Xr rc 8 11090b87619fSMateusz Piotrowskito learn more about 11100b87619fSMateusz Piotrowski.Va autoboot ) , 11113d03791bSMike Makonnenor 11128fe51638SYaroslav Tykhiy.Ic checkyesno Ar always 11138fe51638SYaroslav Tykhiyindicates a truth value, then a 11148fe51638SYaroslav Tykhiy.Dv SIGTERM 11153d03791bSMike Makonnensignal is sent to the parent 11168fe51638SYaroslav Tykhiyprocess, which is assumed to be 11178fe51638SYaroslav Tykhiy.Xr rc 8 . 11188fe51638SYaroslav TykhiyOtherwise, the shell exits with a non-zero status. 1119aa3b7a2fSSimon J. Gerraty.It Ic vdot Ar file ... 1120aa3b7a2fSSimon J. GerratyFor reading in only verified files. 1121aa3b7a2fSSimon J. Gerraty.Pp 1122aa3b7a2fSSimon J. GerratyEnsure shell 1123aa3b7a2fSSimon J. Gerraty.Li verify 1124aa3b7a2fSSimon J. Gerratyoption is on. 1125aa3b7a2fSSimon J. GerratyThis option is only meaningful when 1126aa3b7a2fSSimon J. Gerraty.Xr mac_veriexec 4 1127aa3b7a2fSSimon J. Gerratyis active, 1128aa3b7a2fSSimon J. Gerratyotherwise this function is effectively the same as 1129aa3b7a2fSSimon J. Gerraty.Ic dot . 1130aa3b7a2fSSimon J. Gerraty.Pp 1131aa3b7a2fSSimon J. GerratyRead in each 1132aa3b7a2fSSimon J. Gerraty.Ar file 1133aa3b7a2fSSimon J. Gerratyif it exists and 1134aa3b7a2fSSimon J. Gerraty.Ic is_verfied Ar file 1135aa3b7a2fSSimon J. Gerratyis successful, otherwise set return code to 80 (EAUTH). 1136aa3b7a2fSSimon J. Gerraty.Pp 1137aa3b7a2fSSimon J. GerratyRestore previous state of the 1138aa3b7a2fSSimon J. Gerraty.Li verify 1139aa3b7a2fSSimon J. Gerratyoption. 1140eec3e03eSRuslan Ermilov.It Ic wait_for_pids Op Ar pid ... 114154e347fbSGordon TetlowWait until all of the provided 114254e347fbSGordon Tetlow.Ar pids 1143eec3e03eSRuslan Ermilovdo not exist any more, printing the list of outstanding 114454e347fbSGordon Tetlow.Ar pids 114554e347fbSGordon Tetlowevery two seconds. 114654e347fbSGordon Tetlow.It Ic warn Ar message 114754e347fbSGordon TetlowDisplay a warning message to 1148eec3e03eSRuslan Ermilov.Va stderr 114954e347fbSGordon Tetlowand log it to the system log 115054e347fbSGordon Tetlowusing 115154e347fbSGordon Tetlow.Xr logger 1 . 115254e347fbSGordon TetlowThe warning message consists of the script name 115354e347fbSGordon Tetlow(from 1154eec3e03eSRuslan Ermilov.Va $0 ) , 115554e347fbSGordon Tetlowfollowed by 1156eec3e03eSRuslan Ermilov.Dq Li ": WARNING: " , 115754e347fbSGordon Tetlowand then 115854e347fbSGordon Tetlow.Ar message . 115954e347fbSGordon Tetlow.El 116054e347fbSGordon Tetlow.Sh FILES 116185986815SMateusz Piotrowski.Bl -tag -width "/etc/rc.subr" -compact 116254e347fbSGordon Tetlow.It Pa /etc/rc.subr 116354e347fbSGordon TetlowThe 116454e347fbSGordon Tetlow.Nm 116554e347fbSGordon Tetlowfile resides in 116654e347fbSGordon Tetlow.Pa /etc . 116754e347fbSGordon Tetlow.El 116854e347fbSGordon Tetlow.Sh SEE ALSO 116954e347fbSGordon Tetlow.Xr rc.conf 5 , 11706e1fc011SGraham Percival.Xr debug.sh 8 , 117154e347fbSGordon Tetlow.Xr rc 8 117254e347fbSGordon Tetlow.Sh HISTORY 1173eec3e03eSRuslan ErmilovThe 117454e347fbSGordon Tetlow.Nm 1175eec3e03eSRuslan Ermilovscript 117654e347fbSGordon Tetlowappeared in 117754e347fbSGordon Tetlow.Nx 1.3 . 117854e347fbSGordon TetlowThe 117954e347fbSGordon Tetlow.Xr rc.d 8 118054e347fbSGordon Tetlowsupport functions appeared in 118154e347fbSGordon Tetlow.Nx 1.5 . 1182eec3e03eSRuslan ErmilovThe 118354e347fbSGordon Tetlow.Nm 1184eec3e03eSRuslan Ermilovscript 118554e347fbSGordon Tetlowfirst appeared in 118654e347fbSGordon Tetlow.Fx 5.0 . 1187